Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTML form auto fill values?

Tags:

html

if I had a HTML form like so...

    <form>
    First name: <input type="text" name="firstname" /><br />
    Last name: <input type="text" name="lastname" /> 
    </form>

How would I auto fill both First name and Last Name with a default value? e.g "joe".

Thanks.

like image 241
Skizit Avatar asked Dec 28 '22 09:12

Skizit


1 Answers

Use the value attribute.

… but please make them sensible defaults (e.g. "The user's name as stored in their account on your site") and not examples.

(And do use label elements instead of free text for your labels).

like image 128
Quentin Avatar answered Dec 31 '22 12:12

Quentin