Hi,
How to display error message in add/edit form,if given Primary Key ID is present i want error saying 'cont add'.Is it Possible?
You can use phpgrid_error("Error message"); on server side.
Please refer sample editing > server validation for working demo.
Hi,
when user make mistake while adding record it shows error with dml query, i want to hide this, how can i do the same?
You need to set debug = 0;
$g = new jqgrid();
$g->debug = 0;
You can also change generic error message.
$g->error_msg = "Some issues occured in this operation, Contact technical support for help";
It will replace all error messages (dml etc) with your provided error text.
If you wish to remove the error displaying dialog (which is not recommended)
you can edit jqgrid_dist.php and remove following:
// on error
$out .= ",'loadError': function(xhr,status, err) {
try
{
jQuery.jgrid.info_dialog(jQuery.jgrid.errors.errcap,'<div class="ui-state-error">'+ xhr.responseText +'</div>',
jQuery.jgrid.edit.bClose,{buttonalign:'right'});
}
catch(e) { alert(xhr.responseText);}
}
";
You can refer demos/ediitng/server-validation.php samle code for duplicate record check.