I`ve the following code. There is a dialog with terms loaded and it shows on a form submit. Help me please to submit the form by the agree button in a dialog.
$(".terms").dialog({
autoOpen: false,
modal: true,
height: 400,
width: 500,
buttons: {
"I agree": function() {
return $("#new_user").submit();
},
"Don`t agree - Exit": function() {
return $(this).dialog("close");
}
}
});
$("#new_user").submit(function(e) {
e.preventDefault();
return $(".terms").dialog("open");
});
Thanks!
i agree? every time you submit the same dialog will appear again?