Question about HTML forms and pre-filling fields

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

Question about HTML forms and pre-filling fields

Post by tomdkat »

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...
Locked