Can anyone point out the problem with this? The commented regex var
and if statement dont work and break the GroupName check when
uncommented. I tested the AccessCodeRegxp with preg_match and it seems
to work fine, it just wont here. Any pointers would be great.
<script language="javascript"><!--
function check_form() {
var error = 0;
var error_message = "<?php echo JS_ERROR; ?>";
var customers_group_name =
document.customers.customers_group_name.value;
var customers_group_access_code =
document.customers.customers_group_access_code.val ue;
var GroupNameRegxp = /^([0-9a-zA-Z]+){8,32}$/;
/* var AccessCodeRegxp =
/^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%^&*]).{6,12}$/;*/
if (!GroupNameRegxp.test(customers_group_name)) {
error_message = error_message + "<?php echo
ERROR_CUSTOMERS_GROUP_NAME.'\n'; ?>";
error = 1;
}
/* if (!AccessCodeRegxp.test(customers_group_access_code ) {
error_message = error_message + "< ?php echo
ERROR_CUSTOMERS_GROUP_ACCESS_CODE; ?>";
error = 1;
}*/
if (error == 1) {
alert(error_message);
return false;
} else {
return true;
}
}
//--></script>
Matt Mika
"These animals evacuate ethyl alcohol from their bowels and carbon dioxide from their urinary organs. Thus, one can observe how a specially lighter fluid is exuded from the anus and rises vertically whereas a stream of carbon dioxide is ejected at very short intervals from enormously long genitales."
Justus Freiherr von Liebig - 1839