radio button form field

// Construct availability radio control
if ( $availability == "S" ) {
  $availability_button =
    '<div><input type="radio" name="availability" id="availSub" value="S" checked="checked"/>' .
    ' <label for="availSub">Substitute</label><br/>' .
    '<input type="radio" name="availability" id="availReg" value="R"/>' .
    ' <label for="availReg">Regular</label><br/>' .
    '<input type="radio" name="availability" id="availAssist" value="A"/>' .
    ' <label for="availAssist">Assistant</label><br/>' .
    '<input type="radio" name="availability" id="availNone" value="N"/>' .
    ' <label for="availNone">None</label></div>';
} elseif ( $availability == "R" ) {
  $availability_button =
    '<div><input type="radio" name="availability" id="availSub" value="S"/>' .
    ' <label for="availSub">Substitute</label><br/>' .
    '<input type="radio" name="availability" id="availReg" value="R" checked="checked"/>' .
    ' <label for="availReg">Regular</label><br/>' .
    '<input type="radio" name="availability" id="availAssist" value="A"/>' .
    ' <label for="availAssist">Assistant</label><br/>' .
    '<input type="radio" name="availability" id="availNone" value="N"/>' .
    ' <label for="availNone">None</label></div>';
} elseif ( $availability == "A" ) {
  $availability_button =
    '<div><input type="radio" name="availability" id="availSub" value="S"/>' .
    ' <label for="availSub">Substitute</label><br/>' .
    '<input type="radio" name="availability" id="availReg" value="R"/>' .
    ' <label for="availReg">Regular</label><br/>' .
    '<input type="radio" name="availability" id="availAssist" value="A" checked="checked"/>' .
    ' <label for="availAssist">Assistant</label><br/>' .
    '<input type="radio" name="availability" id="availNone" value="N"/>' .
    ' <label for="availNone">None</label></div>';
} elseif ( $availability == "N" ) {
  $availability_button =
    '<div><input type="radio" name="availability" id="availSub" value="S"/>' .
    ' <label for="availSub">Substitute</label><br/>' .
    '<input type="radio" name="availability" id="availReg" value="R"/>' .
    ' <label for="availReg">Regular</label><br/>' .
    '<input type="radio" name="availability" id="availAssist" value="A"/>' .
    ' <label for="availAssist">Assistant</label><br/>' .
    '<input type="radio" name="availability" id="availNone" value="N" checked="checked"/>' .
    ' <label for="availNone">None</label></div>';
} else {
  $availability_button =
    '<div><input type="radio" name="availability" id="availSub" value="S"/>' .
    ' <label for="availSub">Substitute</label><br/>' .
    '<input type="radio" name="availability" id="availReg" value="R"/>' .
    ' <label for="availReg">Regular</label><br/>' .
    '<input type="radio" name="availability" id="availAssist" value="A"/>' .
    ' <label for="availAssist">Assistant</label><br/>' .
    '<input type="radio" name="availability" id="availNone" value="N"/>' .
    ' <label for="availNone">None</label></div>';
}
Advertisements

About samehramzylabib

See About on https://samehramzylabib.wordpress.com
This entry was posted in Coding, PHP Form Fields and tagged , , , . Bookmark the permalink.

Comment

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s