Seeking to defeat auto-fill

  • Thread starter Charles Richmond
  • Start date
C

Charles Richmond

Is there some parameter I can set via Javascript that will
cause the browser to *not* auto-fill forms, regardless of
the browser settings???
 
J

Jorge

Is there some parameter I can set via Javascript that will
cause the browser to *not* auto-fill forms, regardless of
the browser settings???

Buid the form dynamically, and use weird field names with a random
part, such as name_675sd4Y. Then strip the random part at the server
side. ISTM this may work.

javascript:alert("_"+(Math.floor(1e8*Math.random())).toString(36))
 
D

dhtml

J

Jorge

Buid the form dynamically, and use weird field names with a random
part, such as name_675sd4Y. Then strip the random part at the server
side. ISTM this may work.

javascript:alert("_"+(Math.floor(1e8*Math.random())).toString(36))

Forget it. This ^^^ doesn't do it:

<https://developer.mozilla.org/En/
How_to_Turn_Off_Form_Autocompletion> : "Note that variants of key
words such as "Name1", "Address2" will also trigger the prompt."

What dhtml has told you is the right thing.
 
M

Matthias Watermann

Is there some parameter I can set via Javascript that will cause the
browser to *not* auto-fill forms, regardless of the browser settings???

Why would you hinder the users of such a form?


--
Matthias
/"\
\ / ASCII RIBBON CAMPAIGN - AGAINST HTML MAIL
X - AGAINST M$ ATTACHMENTS
/ \
 
M

Matthias Watermann

You can disable autocomplete on a form with:

<form autocomplete='off' ...>

Which DTD allows such a tag attribute?


--
Matthias
/"\
\ / ASCII RIBBON CAMPAIGN - AGAINST HTML MAIL
X - AGAINST M$ ATTACHMENTS
/ \
 
T

Thomas 'PointedEars' Lahn

Matthias said:
Which DTD allows such a tag attribute?

No standardized one, so that's bad advice indeed. However, it might be
possible to set a corresponding property of the corresponding element
object in a suitable place instead.


PointedEars
 
D

dhtml

Thomas said:
No standardized one, so that's bad advice indeed.

It gets the job done. Browsers that don't handle autocomplete will
ignore it.

However, it might be
possible to set a corresponding property of the corresponding element
object in a suitable place instead.

The ajax form's autocomplete property set to "off"

form.autocomplete = "off".
 
C

Charles Richmond

Matthias said:
Why would you hinder the users of such a form?

The fields I want to disable auto-complete... only accept
numbers from 1 to 31. Auto-complete becomes more of a distraction
than a help here.
 
T

Thomas 'PointedEars' Lahn

dhtml said:
It gets the job done. Browsers that don't handle autocomplete will
ignore it.

That's inexperience talking; you just can't know that.
However, it might be

The ajax form's autocomplete property set to "off"

form.autocomplete = "off".

Yes, that's what I meant.


PointedEars
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top