Project

General

Profile

« Previous | Next » 

Revision 1437

Added by DarkViper over 13 years ago

little fixes for xhtml-validity module 'form'

View differences:

branches/2.8.x/wb/modules/form/view.php
60 60
function make_checkbox(&$n, $idx, $params) {
61 61
	$field_id = $params[0][0];
62 62
	$seperator = $params[0][1];
63
	$label_id = 'wb_'.str_replace(" ", "_", $n);
63
	$label_id = 'wb_'.preg_replace('/[^a-z0-1]/i', '_', $n);
64 64
	if(in_array($n, $params[1])) {
65 65
		$n = '<input class="field_checkbox" type="checkbox" id="'.$label_id.'" name="field'.$field_id.'['.$idx.']" value="'.$n.'" checked="checked" />'.'<label for="'.$label_id.'" class="checkbox_label">'.$n.'</lable>'.$seperator;
66 66
	} else {
......
74 74
	$field_id = $params[0];
75 75
	$group = $params[1];
76 76
	$seperator = $params[2];
77
	$label_id = 'wb_'.str_replace(" ", "_", $n);
77
	$label_id = 'wb_'.preg_replace('/[^a-z0-1]/i', '_', $n);
78 78
	if($n == $params[3]) { 
79 79
		$n = '<input class="field_radio" type="radio" id="'.$label_id.'" name="field'.$field_id.'" value="'.$n.'" checked="checked" />'.'<label for="'.$label_id.'" class="radio_label">'.$n.'</label>'.$seperator;
80 80
	} else {
......
178 178
		}
179 179
		if($field['type'] == 'textfield') {
180 180
			$vars[] = '{FIELD}';
181
			$values[] = '<input type="text" name="field'.$field_id.'" id="field'.$field_id.'" maxlength="'.$field['extra'].'" value="'.(isset($_SESSION['field'.$field_id])?$_SESSION['field'.$field_id]:$value).'" class="textfield" />';
181
			$max_lenght_para = (intval($field['extra']) ? ' maxlenght="'.intval($field['extra']).'"' : '');
182
			$values[] = '<input type="text" name="field'.$field_id.'" id="field'.$field_id.'"'.$max_lenght_para.' value="'.(isset($_SESSION['field'.$field_id])?$_SESSION['field'.$field_id]:$value).'" class="textfield" />';
182 183
		} elseif($field['type'] == 'textarea') {
183 184
			$vars[] = '{FIELD}';
184 185
			$values[] = '<textarea name="field'.$field_id.'" id="field'.$field_id.'" class="textarea" cols="25" rows="5">'.(isset($_SESSION['field'.$field_id])?$_SESSION['field'.$field_id]:$value).'</textarea>';
......
208 209
			$values[] = implode($options);
209 210
		} elseif($field['type'] == 'email') {
210 211
			$vars[] = '{FIELD}';
211
			$values[] = '<input type="text" name="field'.$field_id.'" id="field'.$field_id.'" value="'.(isset($_SESSION['field'.$field_id])?$_SESSION['field'.$field_id]:'').'" maxlength="'.$field['extra'].'" class="email" />';
212
			$max_lenght_para = (intval($field['extra']) ? ' maxlenght="'.intval($field['extra']).'"' : '');
213
			$values[] = '<input type="text" name="field'.$field_id.'" id="field'.$field_id.'" value="'.(isset($_SESSION['field'.$field_id])?$_SESSION['field'.$field_id]:'').'"'.$max_lenght_para.' class="email" />';
212 214
		}
213 215
		if(isset($_SESSION['field'.$field_id])) unset($_SESSION['field'.$field_id]);
214 216
		if($field['type'] != '') {
branches/2.8.x/wb/modules/form/add.php
19 19
if(defined('WB_PATH') == false) { die("Cannot access this file directly"); }
20 20

  
21 21
// Insert an extra rows into the database
22
$header = '<table cellpadding=\"2\" cellspacing=\"0\" border=\"0\" width=\"98%\">';
22
$header = '<table cellpadding=\"2\" cellspacing=\"0\" border=\"0\" width=\"98%\" summary=\"form\">';
23 23
$field_loop = '<tr><td class=\"field_title\">{TITLE}{REQUIRED}:</td><td>{FIELD}</td></tr>';
24 24
$footer = '<tr><td>&nbsp;</td>
25 25
<td>

Also available in: Unified diff