Skip to content

How to Create a Confirm Dialog Box Before Submit a Change?

You can use eventjqGridAddEditBeforeSubmit and add confirm dialog to return true or false.


$addEditBeforeSubmit = <<<BEFORESUBMIT
function (event, status, postData)
{
    if( confirm('Are you sure you want to update this row?') ) {      
    // do something      
        return [true,''];  
    } else {      
        return [false, 'You can not submit!'];  
    }
}
BEFORESUBMIT;

$dg->add_event("jqGridAddEditBeforeSubmit", $addEditBeforeSubmit);

Feedback and Knowledge Base