* Based upon CGI/Ex/Validate.pm v1.14 from Perl *
* For instructions on usage, see perldoc of CGI::Ex::Validate *
***----------------------------------------------------------------**/
-// $Revision: 1.38 $
+// $Revision: 1.41 $
function Validate () {
this.error = vob_error;
if (n_values == 0 || (n_values == 1 && values[0].length == 0)) {
for (var i = 0; i < tests.length; i ++) {
var el = form[field];
+ if (! el) continue;
var type = el.type;
if (type && (type == 'hidden' || type == 'password' || type == 'text' || type == 'textarea' || type == 'submit'))
el.value = values[0] = '' + field_val[tests[i]];
if (! this.filter_types('do_not_trim',types).length)
values[i] = values[i].replace('^\\s+','').replace(new RegExp('\\s+$',''),'');
if (this.filter_types('trim_control_chars',types).length)
- values[i] = values[i].replace(new RegExp('\t', 'g'),' ').replace(new RegExp('[^\x00-\x1F]+','g'),'');
+ values[i] = values[i].replace(new RegExp('\t', 'g'),' ').replace(new RegExp('[\\x00-\\x1F]+','g'),'');
if (this.filter_types('to_upper_case',types).length) {
values[i] = values[i].toUpperCase();
} else if (this.filter_types('to_lower_case',types).length) {