Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8737445
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T10:31:28+00:00 2026-06-13T10:31:28+00:00

I’m trying to create a way so that when clicking the submit button or

  • 0

I’m trying to create a way so that when clicking the submit button or a link, do the submission
and remain in the same modal dialog.
My program has two forms within the same dialog, one is not shown until the first is submited and i would like that on submiting the first form load, within the same dialog.

For the load dialog i have this code:

function loadDialog(tag, event, target) {
        event.preventDefault();
        var $loading = $('<img src="../../Content/assets/images/nivo-loader.gif" alt="loading" class="ui-loading-icon">');
        var $url = $(tag).attr('href');
        var $title = $(tag).attr('title');
        var $dialog = $('<div></div>');
        $dialog.empty();
        $dialog
        .append($loading)
        .load($url)
        .dialog({
            autoOpen: false
            , title: $title
            , width: 600
            , modal: true
            , minHeight: 200
            , show: 'fade'
            , hide: 'fade'
        });
});

Then in the Create.cshtml:

@model Mvcproject.Models.MyModel
<script language="javascript" type="text/javascript">
$(function () {
    $("input[type=submit]")
        .button(
        );
    $('a.modalDlg2').live("click", function (event) { loadDialog('#modalDlg', event, '#Receipt Create'); });

    /*$('input.Submit').live("click", function (event) {
        e.preventDefault();
        loadDialog('#modalDlg', event, '#Receipt Create');
    });*/

    $(".demo button").button({
        icons:
    {
        primary: 'ui-icon-plusthick'
    }
    });
});
</script>
<h2>
Add line</h2>
@using (Html.BeginForm())
{
@Html.ValidationSummary(true)

<fieldset class="createReceipt">
    <legend>User login</legend>
    @if (ViewBag.Created)
    {
        <table class="createTable">
            <tr>
                <td rowspan="4">
                    <img src="../../Images/no_image.jpg" width="100" height="100" />
                </td>
                <th colspan="1">
                    @Html.LabelFor(model => model.User.Name)
                </th>
                <td colspan="5">
                    @Html.EditorFor(model => model.User.Name)
                    @Html.ValidationMessageFor(model => model.User.Name)
                </td>
            </tr>
            <tr>
                <th colspan="1">
                    @Html.LabelFor(model => model.User.Email)
                </th>
                <td colspan="5">
                    @Html.EditorFor(model => model.User.Email)
                    @Html.ValidationMessageFor(model => model.User.Email)
                </td>
            </tr>
            <tr>
                <th colspan="1">
                    @Html.LabelFor(model => model.User.Password)
                </th>
                <td colspan="5">
                    @Html.EditorFor(model => model.User.Password)
                    @Html.ValidationMessageFor(model => model.User.Password)
                </td>
            </tr>
            <!--User picture-->
            <tr>
                <td>
                    <input type="file" value="browse" name="Browse" accept="image/gif, image/jpeg, image/jpg" />
                </td>
            </tr>
        </table>
        <p>
            <input type="submit" class="Submit" value="Create" />
            <buttonreceipt style="width: 150px; text-align: left">@Html.ActionLink("Create", "Create")</buttonreceipt>
        </p>
    }
    else
    { 
        <!-- This will be displayed when user data is submited and inserted into database-->
        <table class="createTable">
            <tr>
                <th colspan="1">
                    @Html.LabelFor(model => model.User.Name)
                </th>
                <td colspan="5">
                    @Html.DisplayFor(model => model.User.Name)
                </td>
            </tr>
            <tr>
                <th colspan="1">
                    @Html.LabelFor(model => model.User.Email)
                </th>
                <td colspan="5">
                    @Html.DisplayFor(model => model.User.Email)
                </td>
            </tr>
            <tr>
                <td colspan="1">
                    <img src="@Model.User.Picture"/>
                </td>
            </tr>
        </table>
    }
</fieldset>        


}
@if (!ViewBag.Created)
{
    @Html.Partial("_AddUserInformation");
}

ViewBag.Created is either false or true depending on if user data has been inserted with success into database and that functionality is already done.
And _AddUserInformation.cshtml has other information for the user that is trying to register, like address and country…
Hope this explains better my problem.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T10:31:29+00:00Added an answer on June 13, 2026 at 10:31 am

    You can use the jQuery post() function to send data to an address. You’ll need to pick out the data from your fields manually using jQuery selectors (shouldn’t be difficult) as well as configure a function to receive and treat the data. This link on post should give you what you need to get started. http://api.jquery.com/jQuery.post/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to create an if statement in PHP that prevents a single post
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I am trying to understand how to use SyndicationItem to display feed which is
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I am trying to render a haml file in a javascript response like so:
I am doing a simple coin flipping experiment for class that involves flipping a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.