Display jquery dialog after record save using ajax call in Spring MVC and Portlet
I have developed form using Spring 3.0 MVC also used Portlets. I have a following requirement
- When user click on save button store record
- If record is not stored or validation error occurs same page should display error message. After record is saved
- Display a Confirm Box / Prompt Box (with Yes and No button) to ask "Do you want to continue"
- If user click on YES button page should be refresh or reset.
- If user click on NO button page should go back to another page.
I have written following code for this
function storeButtonClick() {
$.ajax({
url: '${myUrl}',
data:$('#myForm').serialize(),
success: function(data){
$.jqDialog.confirm("Do you want to Continue?",
function()
{
alert("This intrusive alert says you clicked YES");
}, // callback function for 'YES' button
function() {
alert("This intrusive alert says you clicked NO");
} // callback fu开发者_运维技巧nction for 'NO' button
);
},
error : function(request) {
alert("in error");//+request.responseText);
}
})
}
My page is not getting displayed with an error message.
Please suggest me how can I develope this page correctly. I'm definitely missing some ajax things.
精彩评论