+ 1
What is the use of "autocomplete" attribute in html5 forms.
9 Réponses
+ 6
'autocomplete' attribute allow ( or disallow ) browser form cache capabilities to suggest prefilled fields to user while typing input...
https://www.w3schools.com/tags/att_input_autocomplete.asp
+ 5
'autocomplete' will also work for form fields with generic 'name' attribute: browsers will suggest input previously entered, even if in other web pages.
'autocomplete' is use to suggest previous user entries... to suggest more stuff ( not previously cached on user side ), you'll have to handle this through JS and server side language ( AJAX will be useful to interface between them ) as suggested by @Apel Mahmod ;)
+ 4
what visph said is right. I just want to add that autocomplete will only work if the user submitted the form once.
use javascript autocomplete for static or dynamic data. in this way user doesn't have to submit the form first
+ 4
You can probably use 'autocomplete' attribute in both <form> and <input>, but I don't really know, so I can't swear ;P
You have to try it yourself, to see how it react in real situation to see...
Anyway, this link can provide more detailed technical stuff about it:
https://developer.mozilla.org/en-US/docs/Web/Security/Securing_your_site/Turning_off_form_autocompletion
+ 4
'autocomplete' is attribute of <input> AND <form>... I understood your last question as can we use in both at same time: wasn't it?
+ 4
@Rajeev Jain wrote: << if you don't use the name attribute in <input> tag the autocomplete="on" is not worked. >>
Without 'name' attribute, it'll store a lot of field values for all undefined input name reference, and it'll display not appropriate suggestions later... as storing by key/value pair allow to suggest only same type on data for named <input>s ;)
So, default behavior sounds more logical to disable always autocomplete feature for undefined name <input>s ^^
0
can we use autocomplete attribute both in <form> tag and <input> tag
0
in w3schools.com autocomplete attribute is use inside the <input> tag
0
@visph
one thing is also most important about autocomplete.
if you don't use the name attribute in <input> tag the autocomplete="on" is not worked.