Sunday, 22 May 2011

Learn PHP online : PHP Day-29

Select Optgroup TextArea using HTML

                                              
Select : By using this tag we can display the dropdown dialog box in the webpage.  A dropdown is a dialog box which can hold the list items. To display the list items Option is the tag.
Sample Script:
<select>
<option>HTML Notes</option>
<option>Java Sctipt Notes</option>
<option>PHP Notes</option>
</select>
Save this script with .html extension.
Optgroup: By using this tag we can group the options.
<select>
<optgroup label="Danphp" style="color:red">
<option>HTMl Notes</option>
<option>PHP Notes</option>
</optgroup>
<optgroup label="HTML" style="color:green">
<option>Notes</option>
<option>PDF</option>
</optgroup>
Save this script with .html extension.
TextArea: By using this tag we can display the multiline textbox in the webpage.

<textarea cols="30" rows="20">
</textarea>
Save this script with .html extension. 
 

2 comments:

Visual comparison of the two methods, creating a simple table.

Option 1, using PHP: // PHP $html = '<table>' ;     foreach ( $data as $row ) {     $html .= '<tr>...