diff options
author | Bill Marquette <billm@pfsense.org> | 2005-03-12 05:44:37 +0000 |
---|---|---|
committer | Bill Marquette <billm@pfsense.org> | 2005-03-12 05:44:37 +0000 |
commit | 6bb5c9aa869fcd65d4f915884a019484f7d4b280 (patch) | |
tree | d4a30511ba27ef354fde77a0e20e93c3b8d93e98 /usr/local/www/wizard.php | |
parent | 0d34044c583f8784cd261ab31d511654b1a2cd52 (diff) | |
download | pfsense-6bb5c9aa869fcd65d4f915884a019484f7d4b280.zip pfsense-6bb5c9aa869fcd65d4f915884a019484f7d4b280.tar.gz |
Client side input validation for the wizard
Fix invalid domain name bug
Diffstat (limited to 'usr/local/www/wizard.php')
-rwxr-xr-x | usr/local/www/wizard.php | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/usr/local/www/wizard.php b/usr/local/www/wizard.php index 3b375b9..9b28557 100755 --- a/usr/local/www/wizard.php +++ b/usr/local/www/wizard.php @@ -120,6 +120,17 @@ if($pkg['step'][$stepid]['stepbeforeformdisplay'] <> "") { <title><?=gentitle_pkg($title);?></title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <link href="gui.css" rel="stylesheet" type="text/css"> + +<script Language="JavaScript"> +<!-- +function FieldValidate(userinput, regexp, message) +{ + if(!userinput.match(regexp)) + alert(message); +} +//--> +</script> + </head> <body link="#0000CC" vlink="#0000CC" alink="#0000CC"> @@ -181,7 +192,11 @@ if($pkg['step'][$stepid]['stepbeforeformdisplay'] <> "") { } if(!$field['dontcombinecells']) echo "<td class=\"vtable\">\n"; - echo "<input id='" . $name . "' name='" . $name . "' value='" . $value . "'>\n"; + + echo "<input id='" . $name . "' name='" . $name . "' value='" . $value . "'"; + if($field['validate']) + echo " onChange='FieldValidate(this.value, \"{$field['validate']}\", \"{$field['message']}\");'"; + echo ">\n"; } else if ($field['type'] == "password") { if(!$field['dontdisplayname']) { echo "<td width=\"22%\" align=\"right\" class=\"vncellreq\">\n"; |