Javascript - Programmatically Click Save Button

  • 29 September 2017
  • 1 reply
  • 44 views

Badge

I am trying to perform custom validation on a form using javascript and then programmatically clicking a Save and Submit button following validation. I followed the example in the community by found here Custom Validation .  However, when I programatically click the button the form will not submit (it does flash and return).

Here is the line that performs the click:   NWF$(".nf-disableonsubmit[value="+buttonName+"]").click();   

I know the click is working, because I put text in the confirmation message property of the button, and I get the alert.  Physically clicking the button causes the form to submit correctly.


1 reply

Userlevel 5
Badge +14

custom validation implemented by that blog, and confirmation message both applies before OOTB validation.

so it looks like OOTB validation doesn't pass through correctly.

is the form ready/valid to submit? do all the controls fit to validation rules and control's validations?

don't you get any error from validation either directly on screen or on developer console?

Reply