Meaningless Drivel is fun!*
The moose likes HTML, CSS and JavaScript and the fly likes Invalid syntax error in IE6 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Invalid syntax error in IE6" Watch "Invalid syntax error in IE6" New topic
Author

Invalid syntax error in IE6

KC Smith
Greenhorn

Joined: Nov 16, 2004
Posts: 7
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

Joined: Jan 10, 2002
Posts: 60766
    
  65

Moving to the HTML/Javascript forum.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
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

Joined: Nov 16, 2004
Posts: 7
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.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Invalid syntax error in IE6
 
Similar Threads
form/input tags and turning off autocomplete
Disable TextBox Ability To Display Old Data Typed In It
autocomplete disabled
Problems with multi-page form
How to make it blank?