cancel
Showing results for 
Search instead for 
Did you mean: 
jml006
Nintex Newbie

Nintex Form with javascript won't save in IE

Jump to solution

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

Labels: (1)
0 Kudos
Reply
3 Replies
Highlighted
Automation Master
Automation Master

Re: Nintex Form with javascript won't save in IE

Jump to solution

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. 




View solution in original post

0 Kudos
Reply
Automation Master
Automation Master

Re: Nintex Form with javascript won't save in IE

Jump to solution

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.

0 Kudos
Reply
jml006
Nintex Newbie

Re: Nintex Form with javascript won't save in IE

Jump to solution

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

0 Kudos
Reply