I have a form like this:
<form action="confirm-and-send.php" method="post" onsubmit="return(confirmation());">
<input a lot of input fields here>
<button type="submit" name="confirm_and_send" id="submit-button" class="sent-to-client-bttn" style="margin-left:630px;margin-top: -125px;"></button>
</form>
then I have jquery ui function
function confirmation(){
$("#some-div").dialog({
bgiframe: true,
autoOpen: false,
minHeight: 200,
width: 350,
modal: true,
closeOnEscape: false,
draggable: false,
resizable: false,
buttons: {
'Yes': function(){
$(this).dialog('close');
callback(true);
},
'No': function(){
$(this).dialog('close');
callback(false);
}
}
});
}
function callback(value){
//do something
}
I am following what they say here and here, but it didn't work for me. If I put event.preventDefault()
the yes button will not submit the for; if I don't put it submits the form before i choose any of the two options. Any can give me a proper example?