Thursday, May 23, 2024
 Popular · Latest · Hot · Upcoming
92
rated 0 times [  96] [ 4]  / answers: 1 / hits: 29616  / 14 Years ago, tue, february 8, 2011, 12:00:00

One of our users just brought up the fact that their browsers Autofill doesn't cause JS onChange events to fire; this causes a problem with user registration for us.



Is this by design? Is there a way to work around it?


More From » autofill

 Answers
79

One solution I have been using occasionally is to check whether the value of the field/input/select differs from it's defaultValue. defaultValue would be the value that was originally in the markup, and value is the current value aka selected or entered value. This would probably differ even though the form was autopopulated.


If you want to turn off autofill altogether, it might be wise to add autocomplete="off"
on fields that are directly connected to your logic.


[#93830] Monday, February 7, 2011, 14 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
alfredoc

Total Points: 261
Total Questions: 128
Total Answers: 89

Location: French Polynesia
Member since Sun, Aug 2, 2020
4 Years ago
alfredoc questions
Thu, Nov 25, 21, 00:00, 3 Years ago
Wed, Aug 4, 21, 00:00, 3 Years ago
;