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

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

Meryk

Guest
Hello, I have a custom submitHandler I am calling on many pages (New, Edit, Quick Create). I just realized that this submitHandler function is called on Cancel too ! Which shouldn't be the case obviously .. Here is what I am doing : $(document).ready(function () { var formEl = formDetails.getFormNode(); //remove existing handler... formEl.removeAttr('onsubmit'); //add custom handler... as we want to launch ui dialog as part of handler tasks.. formEl.submit(onSubmitHandler); // onsubmitHandler defined outside }); Is the 'Cancel' considered as a submit as well ? If yes how can we make sure the submit Handler is only called on Save and the Cancel still behaves normally ? Thank you, Meryem

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