开发者

Display jquery dialog after record save using ajax call in Spring MVC and Portlet

开发者 https://www.devze.com 2023-04-11 18:56 出处:网络
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

I have developed form using Spring 3.0 MVC also used Portlets. I have a following requirement

  1. When user click on save button store record
  2. If record is not stored or validation error occurs same page should display error message.

    After record is saved

  3. Display a Confirm Box / Prompt Box (with Yes and No button) to ask "Do you want to continue"
  4. If user click on YES button page should be refresh or reset.
  5. 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号