MickeC
asked on
Numbers and A to Z in form
One little thing, why is this wrong if i also want a field for a-z, A-Z and 0-9.
if (/^[a-zA-Z0-9]*$/.test(doc ument.mcfo rm.frmPart icipantPas sword.valu e)) {
alert("Only number is allowed for quantity!");
document.mcform.frmPartici pantPasswo rd.focus() ;
return false;
it don't seems to work
if (/^[a-zA-Z0-9]*$/.test(doc
alert("Only number is allowed for quantity!");
document.mcform.frmPartici
return false;
it don't seems to work
<script language="JavaScript" type="text/javascript">
<!--
function MCValidation()
{
if (document.mcform.frmParticipantPassword.value == "") {
alert("Password is required!");
document.mcform.frmParticipantPassword.focus();
return false;
}
if (document.mcform.frmParticipantPassword.value.length < 6) {
alert("Password must contain at least six characters!");
document.mcform.frmParticipantPassword.focus();
return false;
}
if (/^[a-zA-Z0-9]*$/.test(document.mcform.frmParticipantPassword.value)) {
alert("Only number and a-z is allowed!");
document.mcform.frmParticipantPassword.focus();
return false;
}
return true;
}
// -->
</script>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.