Saravanan M
Saravanan M

Reputation: 4747

Making browsers remember (for autocomplete) the values of input fields not enclosed within a <form> tag

I have a requirement wherein my page has few <input> elements and i want the browser to remember the values typed in them and show the autocomplete drop down for subsequent visits. But the problem is I dont have a <form> tag in my page and the processing is done via Javascript/Ajax.

Is there any way i can acheive this?

Upvotes: 1

Views: 1049

Answers (1)

Saravanan M
Saravanan M

Reputation: 4747

Solved by adding a tag around the elements. Thanks Rory. And also prevented the form submission with attribute onsubmit="return false;" on the form tag.

It works on firefox but not in chrome.

Upvotes: 1

Related Questions