Note that there are some explanatory texts on larger screens.

plurals
  1. PODialog pop up doesn't close
    primarykey
    data
    text
    <p>I'm trying to create a dialog box that adds an item to a dropdownlist; here's the code.</p> <pre><code>$(function () { $('#applicantDialog').dialog({ autoOpen: false, width: 600, height: 500, modal: true, title: 'Add Applicant', buttons: { 'Save': function () { var createApplicantForm = $('#createApplicantForm'); if (createApplicantForm.valid()) { $.post(createApplicantForm.attr('action'), createApplicantForm.serialize(), function (data) { if (data.Error != '') { alert(data.Error); } else { // Add the new Applicant to the dropdown list and select it $('#Applicant').append( $('&lt;option&gt;&lt;/option&gt;') .val(data.id_applicant) .html(data.Applicant.Applicant_name) .prop('selected', true) // Selects the new Applicant in the DropDown LB ); $('#applicantDialog').dialog('close'); } }); } }, 'Cancel': function () { $(this).dialog('close'); } } }); $('#applicantAddLink').click(function () { var createFormUrl = $(this).attr('href'); $('#applicantDialog').html('') .load(createFormUrl, function () { // The createGenreForm is loaded on the fly using jQuery load. // In order to have client validation working it is necessary to tell the // jQuery.validator to parse the newly added content jQuery.validator.unobtrusive.parse('#createApplicantForm'); $('#applicantDialog').dialog('open'); }); return false; }); }); </code></pre> <p>My problem is that when the form is saved and the item is added, it never closes the dialog box. When I click on cancel, the list is not updated until I refresh the page. Is it a problem with postback and how can I deal with that? Thanks</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload