Hey guys,
I'm pretty new to jquery so I am having some trouble wrapping my head around some basic things. This time I am having issues getting a form submit to bring up a dialog where if the user cancels than it does a preventDefault() but if they hit OK then it continues with the submission. Right now when I click the submit button, I am not able to get the dialog to popup at all. Can anyone tell me what I may be missing to get this to work?
Here is the code that I am using to try and get this to work:
Code:
$(document).ready(function(){
$('#dialog').dialog({
autoOpen: false,
width: 400,
modal: true,
resizable: false,
buttons: {
"Submit Form": function() {
document.testconfirmJQ.submit();
},
"Cancel": function() {
$(this).dialog("close");
}
}
});
$("#survey_form").submit(function(e){
alert("alert");
e.preventDefault();
$('#dialog').dialog('open');
});
});
Note: I modified code from what I saw when I was googling around for an answer. I didn't see anything on jquery.com that specifically talked about the dialog function so I am not sure that it exists anymore. If it does not exist, is there another way that I can get this to work? Even if using raw javascript?