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 5974983
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T21:01:09+00:00 2026-05-22T21:01:09+00:00

I have a primary form defined and nicely laid out, it does what it

  • 0

I have a primary form defined and nicely laid out, it does what it needs to do…

@{ Html.BeginForm(); }
@Html.ValidationSummary(false)
@Html.AntiForgeryToken()
@Html.EditorFor(model => model)
<h2>Properties</h2>
<hr />
@* I want to put some stuff here... *@
<br class="space" />
<div class="clearfix">>
    <button type="submit" data-bind="click: save">
        Save
    </button>
</div>
@{ Html.EndForm(); }

Now, then. This model (or ViewModel, rather) has an IList<PropertyViewModel> attached to it.

A PropertyViewModel has its own set of validations. They are pretty simple for now, but there is a chance that later there will be more complicated uses for this setup.

I am using KnockoutJS for my viewModel consistency. Though I suppose it is fairly irrelevent. I want to display a second form in a jQuery UI Dialog and return the result, essentially..

<script type="text/javascript">
    var viewModel = {
        name: ko.observable(),
        description: ko.observable(),
        properties: ko.observableArray(),

        save: function () {
            alert(ko.toJSON(viewModel));
        },

        includeProperty: function () {
            $("#dialog").dialog({
                width: 500,
                closeText: '',
                resizable: true,
                buttons: {
                    'Submit': function () {
                        $(this).dialog('close');
                        callback( @* I want the new data to get sent back *@ );
                    },
                    'Cancel': function () {
                        $(this).dialog('close');
                        return false;
                    }
                }
            });
        }
    };
    function callback(value) {
        alert(ko.toJSON(value)); // (I will push the new property to the viewmodel here)
    }
    ko.applyBindings(viewModel);
</script>

However, I am not really sure how to actually put the EditorTemplate into the dialog, moreover I am not sure how to get the data back out of it.

  • 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-05-22T21:01:10+00:00Added an answer on May 22, 2026 at 9:01 pm

    I don’t completely understand your question, but from what I understood what you are trying to do is pass data to the dialog and retrieve data from the dialog. If that is the case then this may be useful:

    http://api.jquery.com/jQuery.data/

    Here is detailed example on how to use:

    Passing data to a jQuery UI Dialog

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

Sidebar

Related Questions

I have a table of the form CREATE TABLE data { pk INT PRIMARY
We have a composite primary key for the site table defined below. Functionally, this
I have two forms. In a primary form I have a button wich calls
I have an InfoPath form set as the primary content type on a Form
I have a form and when I want to set the primary key, I
I have a form that submits parameters using standard HTML controls to a PHP
I have a Django Form class defined likes this in Models : class AccountDetailsForm(forms.Form):
I have a workflow defined on entity A as the primary entity. A is
I have two sections(primary and secondary) in a form with several textboxes which display
I have a form that adds a record to the database. The primary key

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.