CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> Archive -> GotoCode Archive

 about "regular expression"

Print topic Send  topic

Author Message
needhelp
Posted: 12/02/2002, 10:16 PM

I need to validate the form by ccs, but i dont known its format of "regular expression". eg, how to give a format of a zip code? like this? "00000" or others expresson.

thanks!
koder
Posted: 12/02/2002, 11:12 PM

Example to accept only alpha

Control Name: user_name

In your regular expression you type in exactly like this :

new RegExp("^[a-z]+$")

Error Message : Only Alpha

This generates code like this :

//Regular Expression Validation @10-7BED6D90
var user_nameRegExp = new RegExp("^[a-z]+$");
if(!user_nameRegExp.test(document.users.user_name.value)) {
alert("Only Alpha allowed");
document.users.user_name.focus();
return false;
}
//End Regular Expression Validation

//Close page_users_user_name_OnChange @8-BC33A33A
return result;
}
//End Close page_users_user_name_OnChange



The above works for me in IE 5.x

Koder


   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.