Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
430 views
in Technique[技术] by (71.8m points)

html - How to turn off autofill/autocomplete in input in a form?

I used the background image for the signup form and the signup process consists of several steps. So when I return the first step other fields looks good but the autocomplete fields are white for the background and black for the color. I want to remove this for showing the original background. I thought it is because of "autocomplete" attribute. So I filled the form and input with "autocomplete"="off". But it didn't work for me. I also add the code belows

const handleFocus = () => {
  emailInput.current.removeAttribute('readonly')
}
<input readonly="readonly" ref={emailInput} onFocus={handleFocus} type="text" value={value}>

It also didn't work. I hope someone can help me with this problem.

question from:https://stackoverflow.com/questions/65932759/how-to-turn-off-autofill-autocomplete-in-input-in-a-form

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...