简体   繁体   中英

Is there a HTML5 way of pre-filling an email form field with a value previously entered in another email form field?

I have a series of forms one following the other, each with a different URL.

At one point there's an email address form field, then later on in a different form, there's a second email address form field: as per my app, the second one should usually get the same value as the first one, so I want to pre-fill the second one with first one's value.

Is there some simple native HTML5 way to achieve this, or do I need to do it programmatically?

If the user has autofill set-up and the form is correctly built using best practices then the user can focus the input and have a selection of email addresses available.

If you want to use a value previously used on your site/the users' session, then programmatically would be the way to go.

This article is quite helpful in helping you follow form best practices.

https://developers.google.com/web/fundamentals/design-and-ux/input/forms

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM