print a radio button or checkbox : Form « Form « PHP






print a radio button or checkbox

 
function input_radiocheck($type, $element_name, $values, $element_value) {
    print '<input type="' . $type . '" name="' . $element_name .'" value="' . $element_value . '" ';
    if ($element_value == $values[$element_name]) {
        print ' checked="checked"';
    }
    print '/>';
}
  
  








Related examples in the same category

1.print a select menu
2.print a submit button
3.print a text box
4.print a textarea
5.HTML elements for use in forms
6.HTML Form Elements
7.HTML form for submitting data
8.Working with Multipage Forms
9.Process the results