File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Invalid syntax error in IE6" Watch "Invalid syntax error in IE6" New topic

Invalid syntax error in IE6

KC Smith

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++){

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?


Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63844

Moving to the HTML/Javascript forum.

[Asking smart questions] [About Bear] [Books by Bear]
Eric Pascarello

Joined: Nov 08, 2001
Posts: 15385
Why are you setting that dynamiclaly instead of just adding it to the forms?
If JavaScript is disabled then it will not be applied...

KC Smith

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.
I agree. Here's the link:
subject: Invalid syntax error in IE6
It's not a secret anymore!