javascript - Can't access form element in IE because it 'is undefined'. Works ok in FF and Chrome -


This is strange because I only get an error in IE: 'Sittime is undefined' in many input elements in my form Has a ID from Everything works fine in Chrome and FF here is a link to the code:

and form html:

   & Lt; B style = "color: red;" & Gt; At the conclusion: & lt; / B & gt; & Lt; Input id = "eTime" name = "eTime" title = "closing time" value = "click to set closing time" class = "datetimepicker" /> & Lt; B style = "color: blue;" & Gt; Address: & lt; / B & gt; & Lt; Input type = 'text' name = 'road' id = 'road' square = 'text road' autocomplete = 'off' / & gt; & Lt; Input id = 'submit' class = 'submit' style = "cursor: cursor; cursor: hand;" Type = "submit" value = 'add new stop' / & gt; & Lt; Div id = 'suggests' class = 'auto-integer' style = 'display: none' & gt; & Lt; / Div & gt; & Lt; Input type = 'hidden' name = 'late id' = 'late' / & gt; & Lt; Input type = 'hidden' name = 'lng' id = 'lng' / & gt; & Lt; Input type = 'hidden' value = 'ca' name = 'state' id = 'state' class = 'text state' />  

Thank you for your help!

  • verb

  • Instead of using javascript in the onsubmit event, see JS in the element with less ambiguous, eg this.elements.sTime . It may be that the name of the element is used elsewhere in the document.


Comments