You are viewing limited content. For full access, please sign in.

Question

Question

JavaScript not working on IE or Mozilla

asked on October 2, 2018

Hi All,

 

Has anyone noticed an issue where the JavaScript on forms does not function as it should on Internet Explorer or Mozilla but works fine on Chrome and Edge? 

 

We have a client who has come across this on a specific form where Javascript is used to calculate the days as per below:

Example using Chrome:

 

But, when using Mozilla, the client sees the following occurring where the calculations are not triggering? 

 

I will be more than happy to provide the Script, but just wanted to see if anyone has experienced this before? 

 

We also checked and can confirm this is what we see within the Form Certificate General TAB under Mozilla? 

 

The site is using SSL certificate and it is also valid.

 

With thanks,

Ziad

 

0 0

Replies

replied on October 3, 2018

Are there any errors in the browser console log?

0 0
replied on October 3, 2018

Thanks for That Devin, 

 

Will be checking this out to confirm, 

 

Ziad

0 0
replied on October 3, 2018

This doesn't address the underlying issue of your JavaScript problems, but you can accomplish the date calculation without using any custom JavaScript through the built-in Functions in Forms.

The following function will calculate the date difference and display a "Select Dates" message until a date has been entered in both fields, you just need to replace the "Table.Column" variables with the ones that are used in your form.

=IF(AND(INDEX(Table_1.Start_Date,ROW()) <> "",INDEX(Table_1.End_Date,ROW()) <> ""),DATEDIF(INDEX(Table_1.Start_Date,ROW()),INDEX(Table_1.End_Date,ROW()),"D"),"Select Dates")

To break it down,

INDEX(Table.Column,ROW()) - Retrieves the target column value from the current row

IF(AND(Date1 <> "",Date2 <> ""),Difference,"Select Dates") - Checks to see if both fields have values and shows either the calculated difference or the default message.

DATEDIF(Date1,Date2,"D") - Calculates the date difference in Days

If you need to include both the start and end dates (for example, if selecting the same date for both start and end should yield 1 not 0, then just add +1 after the DATEDIF() function, like so:

=IF(AND(INDEX(Table_1.Start_Date,ROW()) <> "",INDEX(Table_1.End_Date,ROW()) <> ""),DATEDIF(INDEX(Table_1.Start_Date,ROW()),INDEX(Table_1.End_Date,ROW()),"D")+1,"Select Dates")
0 0
replied on October 3, 2018

Jason, 

 

Many thanks for that, will def be trying this option and seeing how i go with it, 

 

Appreciate the response, 

Ziad

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.