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 1 - Line: 1415 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 1415 errorHandler->error
/inc/functions.php 1370 fetch_forum_permissions
/printthread.php 76 forum_permissions
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
rsv validation - Printable Version

+- Form Tools (https://forums.formtools.org)
+-- Forum: Form Tools (https://forums.formtools.org/forumdisplay.php?fid=1)
+--- Forum: General Discussion (https://forums.formtools.org/forumdisplay.php?fid=5)
+--- Thread: rsv validation (/showthread.php?tid=828)



rsv validation - bwaye - Aug 31st, 2010

I have worked this for hours to no avail. I don't like to post code but this all looks correct to me. This is a CODE submission.

<script type="text/javascript" src="http://www.mysite.com/myadmin/global/scripts/rsv.js"></script>

<script type="text/javascript">
var rules = [];
rules.push("required,first_name,Please enter your First Name.");
rules.push("required,last_name,Please enter your Last Name.");
rules.push("required,phone,Please enter your phone number.");
rules.push("required,zone_name,Please enter your Zone Name.");
rules.push("required,email,Please enter your email address.");
rules.push("valid_email,email,Please enter a valid email address.");
rules.push("same_as,email,email2,Please Check your Email Address.");
rules.push("valid_email,email_database,Please enter a valid email address.");
rules.push("same_as,email,email_database2,Please Check your Email Address.");
rules.push("required,username,Please enter your User Name.");
rules.push("password,Please enter a password.");
rules.push("same_as,password,password2,Please Check your password.");

// these lines are required if you're using the rsv.js file that's bundled with Form Tools.
// They reset the custom handlers defined in the file
rsv.errorFieldClass = null;
rsv.customErrorHandler = null;
rsv.displayType = "alert-all";
</script>

<form action="<?php echo $_SERVER["PHP_SELF"]?>" method="POST" onsubmit="return rsv.validate(this, rules)">


----------------------

NOTE: http://docs.formtools.org/tutorials/js_validation/?page=finished_product

This example is missing the: rsv.customErrorHandler = null;


RE: rsv validation - Ben - Sep 3rd, 2010

Hi Bwaye,

Thanks for the tip about that tutorial. I'll fix it up right now.

Regarding your code, I don't see any syntax errors. What happens exactly? Do you get any javascript errors? Does the form just submit without doing any validation?

Oh, one thing does look a little fishy: are both of these rules needed? If a rule references a non-existent field, it may well choke.

Code:
rules.push("same_as,email,email2,Please Check your Email Address.");
...
rules.push("same_as,email,email_database2,Please Check your Email Address.");

- Ben