Jump to content

validation


j05hr

Recommended Posts

Drop Menu

<select name="name" id="name">
<option value="Mr" <?php if(isset($_POST['name']) && $_POST['name'] == 'Mr') { echo 'selected="selected"'; } ?> >Mr</option>
</select>

Radio

<input type="radio" name="yes" id="yes" value="Is Yes" <?php if(isset($_POST['yes']) && $_POST['yes'] == 'Is Yes') { echo 'checked="checked"'; } ?> />Yes

Checkbox

<input type="checkbox" name="checkbox[]" id="name" value="Value01" <?php if (isset ($_POST['checkbox']) && in_array ("Value01", $_POST['checkbox'])) echo ' checked="checked"'; ?> />Field Name

Link to comment
https://forums.phpfreaks.com/topic/182776-validation/#findComment-964700
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.