Reputation: 9
In the following code why the dialog is not working?
I import all the jar which are required, any reason behind it or any jar is required?
var val = $('#date').val().trim(); // Remove leading and trailing spaces
// Moved inside click handler
if (!val) { // Check if falsy value
alert("hi");
$("#dialog").dialog();//this particular line is not going to work propery
return false;
}
Upvotes: 0
Views: 59
Reputation: 3105
$("#dialog").dialog();
line would NOT work because you basically do NOT have a tag with id="dialog" in your HTML (if the snippet of HTML is where it was supposed to be).
Make sure you have something similar to below div in your HTML.
<div id="dialog" title="Basic dialog">
<p>This is the default dialog which is useful for displaying information. The dialog window can be moved, resized and closed with the 'x' icon.</p>
</div>
You can find more about JqueryUI dialogs here
Upvotes: 1