Preventing the openning of a form on a add
Did you guys know how to prevent the open of a Form when I click on a add button?

Maybe using beforeShowForm?

<pre><code>
function(formid)
{
	if(jQuery('#gridap').getGridParam('selrow'))
	{
		
		idgridap=jQuery('#gridap').getGridParam('selrow');
		jQuery('#FK_numerocontrato_ap',formid).val(idgridap).attr('readonly','readonly');
		
	}
	else 
	{
         // I want to prevent the openning of the add form here and maybe show an alert using the "alertcap"
               
	}
}
CHECAROW;

$grid->setNavEvent('add','beforeShowForm',$checarowid);

</code></pre>

BTW, there´s a way to call the alertmod of jqgrid and add a custom message to it?

tks!
Preventing the openning of a form on a add
===

Did you guys know how to prevent the open of a Form when I click on a add button?

Maybe using beforeShowForm?

<pre><code>
function(formid)
{
	if(jQuery('#gridap').getGridParam('selrow'))
	{
		
		idgridap=jQuery('#gridap').getGridParam('selrow');
		jQuery('#FK_numerocontrato_ap',formid).val(idgridap).attr('readonly','readonly');
		
	}
	else 
	{
         // I want to prevent the openning of the add form here and maybe show an alert using the "alertcap"
               
	}
}
CHECAROW;

$grid->setNavEvent('add','beforeShowForm',$checarowid);

</code></pre>

BTW, there´s a way to call the alertmod of jqgrid and add a custom message to it?

tks!