The following warnings occurred: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.31 (Linux)
|
![]() |
I've been using FormTools + RSV for a couple year now, and someone just stumped me... - Printable Version +- Form Tools (https://forums.formtools.org) +-- Forum: Modules / Other (https://forums.formtools.org/forumdisplay.php?fid=8) +--- Forum: Form Validation: JS + PHP (https://forums.formtools.org/forumdisplay.php?fid=18) +--- Thread: I've been using FormTools + RSV for a couple year now, and someone just stumped me... (/showthread.php?tid=868) |
I've been using FormTools + RSV for a couple year now, and someone just stumped me... - dethompsOWU2 - Sep 30th, 2010 I have been asked if it is possible for me to validate an e-mail address field so that it is required to be of the form: [SOMETHING]@owu.edu Up until now, it has been sufficient for me to use a valid_email requirement to ensure that the field is of the form: [SOMETHING]@SOMETHING.SOMETHING My question is...how would I go about checking for the former instead of the latter? I'm sure it's relatively simple...I just don't know enough about RegEx or programming in general to make it work. Thanks in advance for any help you can provide, Doug Thompson Manager of Web and Electronic Communications Ohio Wesleyan University RE: I've been using FormTools + RSV for a couple year now, and someone just stumped me... - Ben - Oct 2nd, 2010 Hi Doug, Thanks for the post! You hit the nail on the head: regular expressions are the way to go. Try this: Code: rules.push("regexp,email_field_name,.*@owu\.edu$,Please enter a valid OWU email address."); I confess I haven't tested it out, but that should work okay... knock on wood. You'll need to change the "email_field_name" to the name of your email field, and enter in whatever error message you want. Let me know if you have any trouble! - Ben RE: I've been using FormTools + RSV for a couple year now, and someone just stumped me... - dethompsOWU2 - Oct 4th, 2010 That works perfectly! Thanks, Doug |