Sample text inside Email Field

2 replies
Hi guys.

Can you tell me what i have to add so my form has dummy text inside the input fields, to show a user what type of information to put in the specific box.

i.e
Name:
Eg John Doe

This is part of my code:
<label>Enter Your Name: <?php form_error('Full_Name');?></label>
<input name="Full_Name" type="text" class="input" />
<label>Mobile No: <?php form_error('Phone');?></label>
<input name="Phone" type="text" class="input" />
<label>Pick Up Point:<?php form_error('Pick_Up_Point');?></label>
<input name="Pick_Up_Point" type="text" class="input" />

Appreciate the help

Shaun
#email #field #inside #sample #text
  • Profile picture of the author Brandon Tanner
    That would be the "value" attribute. For example...

    HTML Code:
    <input name="name" type="text" value="Type your name here" />
    And if you want, you can use a little bit of Javascript to erase the "dummy" value when the user clicks on the text box...

    HTML Code:
    <input name="name" type="text" value="Type your name here" onClick="this.value=''" />
    Signature

    {{ DiscussionBoard.errors[8227659].message }}
  • Profile picture of the author brutecky
    You could also use the 'placeholder' attribute:

    <input type="text" name="fname" placeholder="First name">

    Its not supported by pre IE10 though I think, it is by Chrome, FF, and Safari. Me personally I hate IE so I have no problems using something thats not IE supported.
    {{ DiscussionBoard.errors[8228010].message }}

Trending Topics