Forum Post: Re: New Ui - Custom Submit Handler Running On Cancel ?

  • Thread starter Thread starter Mohammed Siraj
  • Start date Start date
Status
Not open for further replies.
M

Mohammed Siraj

Guest
Right, even a cancel is actually a form submit but with particular request parameter ('act') set to identify 'Cancel' from 'Save'. In the submit handler, you can look for the same parameter, i.e.: var formEl = formDetails.getFormNode(); var action = formEl.find('input[name=act]').val(); if (action && action.toLowerCase() === 'cancel') { //cancel event.stopImmediatePropagation();//stop event propagation, however do not prevent form from submitting.. } else { //save.. this is where your form submit handler should take over.. & do all the custom stuff }

Continue reading...
 
Status
Not open for further replies.
Back
Top