The following warnings occurred:
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 783 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 783 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined variable $newpmmsg - Line: 40 - File: global.php(841) : eval()'d code PHP 8.1.31 (Linux)
File Line Function
/global.php(841) : eval()'d code 40 errorHandler->error
/global.php 841 eval
/printthread.php 16 require_once
Warning [2] Undefined array key "style" - Line: 909 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 909 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined property: MyLanguage::$lang_select_default - Line: 5024 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 5024 errorHandler->error
/global.php 909 build_theme_select
/printthread.php 16 require_once
Warning [2] Undefined array key "additionalgroups" - Line: 7162 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 7162 errorHandler->error
/inc/functions.php 5044 is_member
/global.php 909 build_theme_select
/printthread.php 16 require_once
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error



Form Tools
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