* Based upon CGI/Ex/Validate.pm v1.14 from Perl *
* For instructions on usage, see perldoc of CGI::Ex::Validate *
***----------------------------------------------------------------**/
-// $Revision: 1.34 $
+// $Revision: 1.36 $
function Validate () {
this.error = vob_error;
for (var i = 0; i < tests.length; i ++) {
var el = form[field];
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 (type && (type == 'hidden' || type == 'password' || type == 'text' || type == 'textarea' || type == 'submit'))
+ el.value = values[0] = '' + field_val[tests[i]];
}
}
document.load_val_hash(form, val_hash);
// attach handler
- form.onsubmit = function () {return document.validate(this)};
+ var orig_submit = form.onsubmit || function () { return true };
+ form.onsubmit = function (e) { return document.validate(this) && orig_submit(e, this) };
}
// the end //