MozillaZine

Question about HTML forms and pre-filling fields

Discuss how to use and promote Web standards with the Mozilla Gecko engine.
tomdkat
 
Posts: 1348
Joined: October 14th, 2003, 7:53 am

Post Posted November 24th, 2019, 10:14 am

Hi! I need to update a very old HTML form to pre-fill some fields. I *swear* the form used to have its fields pre-filled, but simply specifying the field name and value as a URL parameter, like this:

Code: Select all
www.mysite.com/myform.html?fullName=Bob&phoneNo=555-1212


Sample form:
Code: Select all
<form>
<label>Name:</label> <input type="text" name="fullName" id="fullName">
<label>Phone #:</label> < input type="text" name="phoneNo" id="phoneNo">
</form>


However, I found this isn't working anymore and I need to start using JavaScript to populate the fields. Is my memory failing me or was I always mistaken about how to pre-fill HTML form fields, without using JavaScript?

Thanks in advance!

Peace...

Return to Web Development / Standards Evangelism


Who is online

Users browsing this forum: No registered users and 3 guests