Ask a Question related to Macromedia ColdFusion, Design and Development.
-
capik79 #1
input validation
Hi Experts,
I want my validation include with special character
ex :"`~!@#$%^&*()-_=+[{]}\\|;:\,<.>/? "
I have this code in my program and it works. But i have no idea how to inlude
special character in.
Do anyone know how to make it done?
<script type="text/javascript">
function checkInformation(f){
if(!/[0-9]{1,}/.test(f.fn.value)||!/[a-z]{1,}/.test(f.fn.value)||!/[A-Z]{1,}/.te
st(f.fn.value)){
alert("Your Entry must contain at least one character from each of these sets:
0-9, a-z, A-Z!");
f.fn.focus()
return false
}
if(!/[0-9]{1,}/.test(f.ln.value)||!/[a-z]{1,}/.test(f.ln.value)||!/[A-Z]{1,}/.te
st(f.ln.value)){
alert("Your Entry must contain at least one character from each of these sets:
0-9, a-z, A-Z!");
f.ln.focus()
return false
}
return true
}
</script>
<body>
<form onsubmit="return checkInformation(this)">
<label>First Name:<input type="text" name="fn" value=""></label><br>
<label>Last Name:<input type="text" name="ln" value=""></label><br>
<input type="submit" value="submit">
</form>
</body>
Thx in advance
Shaffiq
capik79 Guest
-
CFFORM validation trumping Custom Validation
Is there any way for custom form validation to work in concert with the cfform validation? I have a custom script that compares the values of two... -
CFFORM Validation trumping Custom Form Validation
Is there any way for custom form validation to work in concert with the cfform validation? I have a custom script that compares the values of two... -
Perl Newbie question: How would you take keyboard input and run a shell scrip with that input?
I don't think you could be vaguer :) Very basic #!/usr/bin/perl # update.pl multiple options command line my @packages = @ARGV foreach... -
validation summary doesnt display when there's client-side validation
I have a custom validator that validates a numeric field, txtField, that allows for thousand separators. I also placed a validation summary so... -
only custom validation control does server side validation?
On a CustomValidator you have to provide the validation code because otherwise it doesn't know what to do for the validation. Other validator... -
vkunirs #2
Re: input validation
Hi
Do you mean that you want have validation to include one special charater
also.
if it is you can write like this also:
if(!/[0-9]{1,}/.test(f.fn.value)||!/[a-z]{1,}/.test(f.fn.value)||!/[A-Z]{1,}/.t
est(f.fn.value)||!/["@,#,"]{1,}/.test(f.fn.value))
{
alert("Your Entry must contain at least one character from each of these
sets: 0-9, a-z, A-Z!");
f.fn.focus()
return false;
}
return true;
vkunirs Guest



Reply With Quote

