I’m the midst of creating a form inside a dialog window with jQuery.
I’m currently loading a partial view with the jQuery load() function, and then adding the view into a jQuery UI dialog box. The partial view contains an html form which also contains a validation script in the markup.
This is how I load the view and instantiate the dialog window:
$('<div/>').load('/controller/view #targetDiv').dialog();
Unfortunately the load() function discards the script inside the partial view. 🙁
The validation script is important since it makes ajax calls to the form controller on an ‘input blur’ event, and returns the server side form-validation response. This means that the validation script must run continuously on the form inside the dialog.
The problem is that I load the view but there is no javascript.
Are there any solutions to this problem?
you can save the javascript codes in a separate
.jsfile and usegetScript()method.