[thelist] Returning form values of inspection

David Bindel dbindel at austin.rr.com
Sat Feb 8 23:33:00 CST 2003


> The way to set a default value for a <select> is through the
> "selected" attribute of an <option>

...

> <option value="perfect_binding" <?php if($binding_type ===
> 'perfect_binding') print 'selected'; ?>>Perfect Binding</option>

Of course, if you want to make it XHTML compliant, you output '
selected="selected"' instead of just ' selected'.


Using the previous example, here's the XHTMLized code:

<option value="perfect_binding"<?php if($binding_type ===
'perfect_binding') print ' selected="selected"'; ?>>Perfect
Binding</option>


HTH,
David Bindel




More information about the thelist mailing list