Nintex Form with javascript won't save in IE

  • 16 October 2017
  • 3 replies
  • 9 views

Badge +2

I have created a Nintex Form and am using custom javascript.  On Save, the javascript checks that 3 fields are not blank based on the value of another drop down field.  Everything works great in Chrome and Firefox, however when trying to save in IE, the page reloads and just goes back to the form and the item doesn't save.  I debugged the form and in Debugger I see "Failed to open http://nameofserver/Lists/ListName/NewForm.aspx?Source=http.....

On the button settings, under Client click, I have if(CheckAllFields() == true) {return true;} else {return false;}.  If I remove this and test in IE, the form saves (obviously without validating the fields) so I suspect that is the reason for the issue.

Can anyone provide insight why this would not work in IE, but everything is fine in other browsers? I wish I could tell end users not to use IE, but that's not an option happy.png


3 replies

Userlevel 5
Badge +14

My guess is that it is interpreting your 'if' statement not as a javascript 'if' but as the 'If" (note: The uppercase i) function that has the syntax of 

If(condition, true result, false result)

You can solve this, probably, by putting a space between the 'if' keyword and the parenthesis (), resulting in

if (CheckAllFields() == true){return true;} else {return false;}‍‍

However, being that it looks as if CheckAllFields() returns a boolean (being that you're checking the return value against 'true'), there doesn't seem to be a need for any of this as it would just return true or false itself, leaving just

CheckAllFields()

Lastly, it is a bit perilous to do validation on a button click if you are not prevent the default behavior of the button on failure. You could easily make this into a validation rule on the control that is dependent on the other three fields, and remove your button based javascript entirely. Not to mention that would actually then highlight the control on failure, and provide better feedback to your users. 

I hope that this helps or points you in the right direction. 




Userlevel 5
Badge +14

I fully agrree with ‌' hints.

you can easily check for emptiness with validation rules - see IsNullOrEmpty() runtime function.

I debugged the form and in Debugger I see "Failed to open http://nameofserver/Lists/ListName/NewForm.aspx?Source=http.....

this doesn't sound to be the reason of problems. you likely see only message after page reload.

there is an 'Clear on navigate' switch in console, which is by default enabled. it causes all the messages are deleted on page (re)load. try to switch it off so that you can see errors from before page reload.

Badge +2

Thank you for the suggestion!  I ended up using validation rules and that works great!

Reply