Quantcast
Viewing all articles
Browse latest Browse all 1103

ARAS 10 Tip : Form Fields in IE and Firefox

In transitioning to ARAS 10, I found that the vast majority of my javascript form code had issues.  The main reason for these issues were caused by the form field values not behaving the same way between Firefox and IE.  

Below is a simple little trick I used to get around this issue that worked very well in my case:

 

<code>

var browserIndex = 0;  //default to 0 for IE, will change to 1 if Firefox

if(document.getElementsByName("field_name_here").item(1)){browserIndex = 1;} //changes index to 1 for firefox 

var value = document.getElementsByName("field_name_here").item(browserIndex).value;  //get your form field vals

</code>


Viewing all articles
Browse latest Browse all 1103

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>