Additonal validations in Onsubmithandler Javascript -


when user clicks submit button; need call function 'deleteorphanrecords' prompts user delete them, when there orphan records deleted. origional code displays error message orphan records , prevents user further processing.

<form  onsubmit="return onsubmithandler()" action="/admin/changesrecorded.html"  method="post" id="submitform"> 

i added additional function onsubmithandlerfunction -

function onsubmithandler()     {         deleteorphanrecords();     // more blackbox code displays alert not allow user delete orphan records.      return true;     } 

the deleteorphanrecords function working fine, have 'loading' window blocks user clicking 'yes/no' buttons on main page when orphan records found. page ends showing alert. how should call deleteorphanrecords can delete records , simultaneously submit form too. in advance!


Comments