• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Invalid syntax error in IE6

 
KC Smith
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm encountering an error in IE6 that seems to be related to setting autocomplete="off" on a form or its elements. The js code is very simple and works - autocomplete is suppressed. But the page fails on submit.

<!--
// script to disable form autocomplete
for(var i=0; i<document.forms.length; i++){
document.forms[i].autocomplete="off";
}
//-->

The application is struts and pages between input forms. From one form if you go forward or backward the browser displays 'invalid syntax error' in the title bar, and a 'page cannot be displayed' error. No errors are thrown on the J2EE server - this seems entirely a browser problem.

The functionality works as intended if the autocomplete attribute is not set on the form.

Anyone encountered this before?

Thanks-

K
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64715
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to the HTML/Javascript forum.
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why are you setting that dynamiclaly instead of just adding it to the forms?
If JavaScript is disabled then it will not be applied...

Eric
 
KC Smith
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The form and fields are created using Struts - i.e. <html:text property="person.firstName"/> - and autocomplete is not an option on those tags. My first choice would be to explicitly set the attribute, but that is not possible.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic