I'm working on a site written in PHP/MySQL. We have a form to reserve time on a calendar and it works great in Mozilla and stores the reservation to our database, but in IE you fill out the form and when you click the "Reserve" button to submit it and nothing happens. All I can think of is that my javascript is not working with IE. I have these lines in my .js file:
resLenT = document.getElementById(resLenElem);
resLenI = resLenT.selectedIndex;
resLen = resLenI + 1;
where resLenElem is a drop-down box. These are the only lines that I can think of at the moment that might be causing trouble in IE. Does this all sound like I'm on the right track or am I way off base?
try:
resLenT = document.getElementById("resLenElem");
notice the quotes around resLenElem
So in the event that it is actually something in my html that is causing the IE failure, this is my 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 />
Am I messing something up there and IE isn't likeing it?
Alright, I figured it out. The problem is that I used the name and id "resLen" for my drop-down box in the php file. Then in my js file, I also called it "resLen". Mozilla was able to look at the js and php files as independent items, but IE was getting confused. Thanks again for all the fast replies! Much appreciated!
as far as I know, IE seems not to make the difference between the name and the id of an element.