-
1. Re: Adding an 'Example Text' in Form Text Fields
Dave Merchant Jul 23, 2014 7:00 AM (in response to Max Resnikoff)In pure HTML5 you simply define the placeholder attribute on an input field. See HTML input placeholder Attribute
-
2. Re: Adding an 'Example Text' in Form Text Fields
Max Resnikoff Jul 23, 2014 8:30 AM (in response to Dave Merchant)Hi,
Thanks for your help.
I have got it working on text fields, but how do I do it for dropdown menus?
For text fields the code is:
<input name="name" type="text" class="formfield" id="name" placeholder="Example" />
But for the dropdown it is:
<select name="Size" class="formfield" id="Size">
My code for the Dropdown list is as follows:
<label for="size"></label>
<span id="spryselect2">
<label for="Size"></label>
<select name="Size" class="formfield" id="Size">
<!--Connection to Other Table Start-->
<option id="0">-- Select Size --</option>
<?php
require("Connections/drama_database.php");
$getallequipsizes = mysql_query("SELECT * FROM equipsizes");
while($viewallequipsizes = mysql_fetch_array($getallequipsizes)){
?>
<option id="<?php echo $viewallequipsizes['id']; ?>"><?php echo $viewallequipsizes['Size'] ?></option>
<?php } ?>
<!--Connection to Other Table End-->
</select>
</span>
-
3. Re: Adding an 'Example Text' in Form Text Fields
Nancy O. Jul 23, 2014 11:59 AM (in response to Max Resnikoff)HTML select lists have no placeholder since they contain options.
<label for="MySelect">Select One:</label>
<select name="MySelect" id="MySelect" size="4" required title="Please select something!">
<option value="1">Audi</option>
<option value="2">Saab</option>
<option value="3">Fiat</option>
<option value="4">BMW</option>
</select>
Nancy O.



