As reported by MichaelBrown here.

Autocomplete can be turned off in most modern browsers. Since it's a html5 attribute we have to use jquery to add it to form items, as the drupal form api does not support the attribute yet.

Adding the following line to closedquestion.js line 12 (inside the Drupal.behaviors.closedQuestion function) should fix the problem:
jQuery('#closedquestion-get-form-for input').attr('autocomplete', 'off');

Comments

jvdkolk’s picture

http://stackoverflow.com/questions/582244/is-there-a-w3c-valid-way-to-di...

Browser auto-complete is often triggered by the field having the same name attribute as fields that were previously filled out. If you could rig up a clever way to have a randomized field name, autocomplete wouldn't be able to pull any previously entered values for the field.

If you were to give an input field a name like "email_<?= randomNumber() ?>", and then have the script that receives this data loop through the POST or GET variables looking for something matching the pattern "email_[some number]", you could pull this off, and this would have (practically) guaranteed success, regardless of browser.

HylkeVDS’s picture

Yes, but that requires modifications of all form handling all over the place... You're free to supply a patch of course :)

jvdkolk’s picture

Title: Avoid browser auto-complete on input fields » @Hylke: Avoid browser auto-complete on input fields

@HylkeVDS: did you already fix this?

  • 65afaee committed on varexport
    Issue #1169356 by HylkeVDS: Added autocomplete="off" to input fields.
    
    
jvdkolk’s picture

Issue summary: View changes
Status: Needs review » Closed (fixed)