3

I have a contact form with six or seven fields.

The user may fill out the form on multiple occasions though, each time, the information they enter on all but the last field is likely to be the same.

I note that on Firefox Desktop, as soon as I start filling out a given field, a suggestion box drops down indicating what I've entered in this field before, so I can click one of the suggestions rather than carry on typing.

But I note that this behaviour is absent on Firefox for Android.

This isn't great for UX since this website has a high proportion of mobile visitors and typing on mobile is (inevitably) more fiddly than typing on a laptop.

I've just tested the same form on Chrome for Android and I'm happy to see that the suggestion box appears - just as it does on Firefox Desktop.

But now it looks like the behaviour is inconsistent (and unpredictable) between browsers and platforms.

I have tried adding to the <form> element:

autocomplete="on"

but this doesn't, as far as I can tell, make any discernible difference.

Is there a cross-browser approach to ensuring that for this form, all users on all browsers on all platforms will always see the suggestion box?

5
  • Are you willing to implement that functionality yourself with some JS and CSS rather than rely on browser support? Not all browsers have that functionality as for as I know, nor do the ones that have it give websites much control over it. – Stephen Ostermiller Mar 23 at 12:41
  • ...and users can disable this "browser" feature. I would have said that "rolling your own" is the only way to make this truly cross-browser/all-users. – MrWhite Mar 23 at 12:44
  • @StephenOstermiller - No, I only wish to take advantage of this feature if it is browser-native. I could polyfill with localStorage if it were vital. But it's not vital. It's simply nice-to-have UX. – Rounin Mar 23 at 13:57
  • @StephenOstermiller - Yes, I could accept that some browsers lack this functionality. Nevertheless it strikes me as unexpected that type-in suggestions should be included in Firefox 86 (Desktop) but absent from Firefox 86 (Mobile) where, if anything, they are more assistive. – Rounin Mar 23 at 14:00
  • @MrWhite - To clarify: cross-browser but at the user's discretion. If users disable the feature, we haven't got a problem. It's only there to assist users. If the user turns off the assist, then they clearly don't need it. – Rounin Mar 24 at 11:48
2

The autocomplete feature is designed to help users complete common form fields, typically things like addresses, usernames, etc..

So if your form fields share common names with other sites, then the browser will show the user the drop downs to select values they have previously entered in that browser on forms with same field names.

If however you want to provide a custom "type-ahead" search feature where the user is show possible options that they haven't typed before, but that you think might be useful (e.g. page titles on your site, product names, etc.) then you will need to implement some custom code to support that. This can vary from something based on a select box (drop-down) if there are only a few possible options (e.g. states or countries), to an API that provides a server side search against your content.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.