I have one registration form on my site in which I save the fields and after saving the form, when the user returns to this registration form again, I want the previous field values ββto be saved in the browser autocomplete. below is my code snippet -
<form class="clearfix"> <input autocomplete="given-name" name="firstName" type="text" placeholder="Enter First Name" class="form-control" value=""> <input autocomplete="family-name" name="lastName" type="text" placeholder="Enter Last Name" class="form-control" value=""> <input autocomplete="email" name="email" type="text" placeholder="Enter Email" class="form-control" value=""> <input autocomplete="tel" name="phoneNumber" type="text" placeholder="Enter Number" class="form-control contactMask" value=""> <input autocomplete="address-line1" name="addressLine1" type="text" placeholder="Street 1" class="form-control"> <input autocomplete="address-line2" name="addressLine2" type="text" placeholder="Street 2" class="form-control" value=""> <a href="javascript:void(0);" className="btn baseBtn primeBtn" onClick={this.signupUser}>Sign Up</a> </form>
In this onClick code of the anchor tag, I am making an ajax call through the user registration function. and after that I want the user data to be automatically populated in the browser autocomplete address in chrome.
I tried the following methods: -
1. Some people suggested using the button's βsendβ button function to save data in autocomplete, instead of having an ajax onClick call form anchor tag. but this also does not work in my case.
2. I went through several messages in which they said to use a custom name and an autocomplete attribute for the field. but when using this browser you can only guess the correct field values.
source share