The site works fine in Mozilla, but not in IE. My js file is incompatible with IE

I am working on a site written in PHP / MySQL. We have the opportunity to reserve time on the calendar, and it works fine in Mozilla and saves the reservation in our database, but in IE you fill out the form and when you click the "Reserve" button to send it, nothing happens. All I can think of is that my javascript is not working with IE. I have these lines in a .js file:

 resLenT = document.getElementById(resLenElem);

 resLenI = resLenT.selectedIndex;
 resLen = resLenI + 1;

where resLenElem is a drop-down list. These are the only lines that I can think of at the moment that can cause problems in IE. Does it all sound like I'm on the right track or I don't have a base?

+3
source share
4 answers

to try:

resLenT = document.getElementById("resLenElem");

note the quotes around resLenElem

+4
source

Ok, I figured it out. The problem is that I used the name and identifier "resLen" for my dropdown in the php file. Then in my js file I also called it "resLen". Mozilla was able to view js and php files as separate elements, but IE got confused. Thanks again for all the quick answers! Really appreciate!

+1
source

, - html, IE, html:

Length of Reservation:<br />
<select id="resLen" name="resLen" style="border:1px solid #000000;padding:2px">
    <option selected>1</option>
    <option>2</option>
    <option>3</option>
    <option>4</option>
    <option>5</option>
    <option>6</option>
    <option>7</option>
    <option>8</option>
    </select> hr(s)<br /><br />

- , IE ?

0

, IE, , .

0

Source: https://habr.com/ru/post/1750304/


All Articles