loading page only after event raised from jquery m

2019-08-15 17:24发布

I am validating a form which has bit complex logic. where one after another validation is done. I mean if one validation is run then next validation depends upon first validation

Eg, there are multiple select boxes if one box has negative value then another cannot have +ve value it must have negative value. and a message box is to be shown with showing the error and a message with a checkbox that says it is correct. and if it checks the box then they can enter both positive and negative value. so to do this i used a jquery modal dialog-confirm box. but like these there are multiple cases and logics. for whom i used the dialog box with a single div with id dialog_modal and i passed the message dynamically with jquery. But what happened was the jquery modal dialog box only appears for the last validation

so i want is to break the page loading process when the dialog modal is called and only continue after any button is pressed. I have a function for the dialog modal like this...

function dialog(param){
    $("#dialog_modal").addClass(param);
    $( "#dialog_modal ."+param ).dialog({
        resizable: false,
        modal: true,
        buttons: {
            Yes: function() {
                eval(param+'_ok()');
                $( this ).dialog("close" );
        },
            No: function() {
                eval(param+'_cancel()');
                $( this ).dialog( "close" );
            }
        }
    });
}

If it is bit messy to understand than you can ask me....Its a bit complex

0条回答
登录 后发表回答