The following warnings occurred:
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.27 (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.27 (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.27 (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.27 (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.27 (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.27 (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.27 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 165 errorHandler->error



Form Tools
Trouble Validating Select Boxes - 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: Trouble Validating Select Boxes (/showthread.php?tid=218)



Trouble Validating Select Boxes - sebgonz - Jul 19th, 2009

Hello, I've gotten my validation to work on everything except my select boxes. I don't know what the rule is that I would need to put into my page to get it to work. Can anyone help me?
Here's my form code:
Code:
<form action="http://www.researchride.com/register/process.php" method="post" onsubmit="return rsv.validate(this, rules)">
<ul>
<li>
<input name="form_tools_form_id" type="hidden" value="1" /></li>
<li> <label class="name" for="name">Full Name:</label>
<div>
<input name="name" type="text" /></div>
</li>

<li> <label class="email" for="email">Email:</label>
<div>
<input name="email" type="text" /></div>
</li>
<li> <label class="shirt" for="shirtsize">Shirt Size:</label>
<div>
<select id="shirt" name="shirtsize">  <option value="Small">Small</option> <option value="Medium">Medium</option> <option value="Large">Large</option> <option value="X-Large">X-Large</option> <option value="XX-Large">XX-Large</option> <option value="XXX-Large">XXX-Large</option> </select>

</div>
</li>
<li> <label class="events" for="events">Participating In:</label>
<div>
<select id="events" name="events"> <option selected="selected" value="Select One">Select One</option> <option value="Lunch-Only">Lunch Only</option> <option value="Both">Ride and Lunch</option> </select>
</div>
</li>
<li>

<div>
<input id="submit" class="submit-button" name="submit" type="submit" value="Sign Up" /></div>
</li>
</ul>
</form>
</div>

And here are the rules that I've set already.

Code:
<script type="text/javascript">
var rules = [];
rules.push("required,name,Please enter your full name.");
rules.push("required,email,Please enter your email address.");
rules.push("valid_email,email,Please enter a valid email address.");
rules.push("required,shirt,Please enter your shirt size.");
rules.push("required,events,Please indicate what you will be participating in.");

// *IMPORTANT!* these lines are required if you're using the rsv.js file that's bundled
// with Form Tools. They reset the custom options used throughout the main Form Tools
// script that won't be needed for your own forms
rsv.errorFieldClass = null;
rsv.customErrorHandler = null;
rsv.displayType = "display-html";

</script>

"shirt" and "events" aren't working because there IS a selected option already: "Select One". Now what I'm wondering is if I can exclude that option and have it validate the rest.
I got it. All I needed to do was change
Code:
<option selected="selected" value="Select One">Select One</option>
to
Code:
<option selected value="">Select One</option>

Don't know why I didn't think of that before. :S


RE: Trouble Validating Select Boxes - Sofia45 - Oct 25th, 2021

The norms of private mentoring are bewildering than the guidelines of the association direction division. Truth be told, even their schedule is stunning. I love to visit resumeprofessionalwriters reviews source to hire a desired teacher for myself as this immense distinction aggravates the kids. This si remarkably exasperated circumstance.