The following warnings occurred: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.31 (Linux)
|
![]() |
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."); - Ben |