I've developed a Vue application that includes a form. Once the user clicks on submit, an Ajax request is made using Axios through a JavaScript function. The data being sent is a custom JSON object that I have constructed by combining the information from the input fields. Below is a simplified version of the code:
<form method="post" v-on:submit.prevent>
<input name="emailAddress" v-model="emailAddress" autocomplete="email"/>
<button type="submit" v-on:click="submit()">Submit</button>
</form>
submit: function(){
var jsonObject = {testValue : this.emailAddress +"123"};
axios.post(MY_URL, jsonObject)
.then(response => {
...
})
.catch(error => {
....
})
}
Upon submitting and reloading the page, my expectation was to see suggestions for the recently entered email when filling out the email input field again. However, this does not occur. My assumption is that it could be due to not submitting the form with the email input in multipart/form-data format.
Is there a way to update the browser's autocomplete/autofill feature when submitting the form as I currently am doing?