OK. If you stil think I should insert that after seeing this, I shall give it a try. And appreciate the help!
// Set up values for unchecked checkboxes and unselected radio types
else if ( 'checkbox' == $field['type'] || 'radio' == $field['type'] )
self::$form_data[$field['slug']] = '';
else if ( 'checkbox-multiple' == $field['type'] )
self::$form_data[$field['slug']] = array();
// XXX changed for option to hide labels that do not have field values, like when not required.
// self::$email_msg .= self::make_bold( $field['label'] ) . $inline_or_newline;
// Required validate
// ..different for checkbox-multiple, select types. Not for hidden, checkbox
if ( in_array($field['type'], self::$select_type_fields) ) {
//if ( 'checkbox' != $field['type'] ) {
// select, select-multiple, checkbox-multiple require at least one item to be selected
if ( 'subject' == $field['slug'] && 'select' == $field['type']) {
self::$selected_subject = self::validate_subject_select( $field );
} else if ( 'select' == $field['type']) {
self::validate_select( $field['slug'], $field );
} else if ( 'true' == $field['req'] ) {
if ( ! isset($_POST[$field['slug']]) ) {
self::$form_errors[$field['slug']] = (self::$form_options['error_select'] != '') ? self::$form_options['error_select'] : __('At least one item in this field is required.', 'si-contact-form');
}
}
//}
} else if ( 'hidden' != $field['type'] && 'attachment' != $field['type'] ) {
if ( 'true' == $field['placeholder'] && $field['default'] != '' && isset($_POST[$field['slug']]) ) {
// strip out the placeholder they posted with
$examine_placeholder_input = '';
$examine_placeholder_input = stripslashes($_POST[$field['slug']]);
if ($field['default'] == $examine_placeholder_input ) {
$_POST[$field['slug']] = '';
}
case 'radio' :
// the response is the number of a single option
// Get the options list
$opts_array = explode("\n",$field['options']);
if ( '' == $opts_array[0] && 'checkbox' == $field['type'] )
$opts_array[0] = $field['label']; // use the field name as the option name
if ( ! isset( $opts_array[self::$form_data[$field['slug']]-1] ) && self::$form_options['email_hide_empty'] == 'true' ) {
} else {
if ( isset($opts_array[self::$form_data[$field['slug']]-1]) ) {
self::$email_msg .= self::make_bold( $field['label'] ) . $inline_or_newline;
//self::$email_fields[$field['slug']] = ' * ' . $opts_array[self::$form_data[$field['slug']]-1];
self::$email_fields[$field['slug']] = $opts_array[self::$form_data[$field['slug']]-1];
// is this key==value set? use the key
if ( preg_match('/^(.*)(==)(.*)$/', self::$email_fields[$field['slug']], $matches) ) {
self::$email_fields[$field['slug']] = $matches[1];
}
self::$email_msg .= self::$email_fields[$field['slug']] . self::$php_eol . self::$php_eol;
}
}
break;