The Form Tools forums are no longer active, but the old posts have been archived here. Please see the Help page on how to get help / report issues.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Trouble Validating Select Boxes
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:
<form action="" method="post" onsubmit="return rsv.validate(this, rules)">
<input name="form_tools_form_id" type="hidden" value="1" /></li>
<li> <label class="name" for="name">Full Name:</label>
<input name="name" type="text" /></div>

<li> <label class="email" for="email">Email:</label>
<input name="email" type="text" /></div>
<li> <label class="shirt" for="shirtsize">Shirt Size:</label>
<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>

<li> <label class="events" for="events">Participating In:</label>
<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>

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

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

<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";


"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
<option selected="selected" value="Select One">Select One</option>
<option selected value="">Select One</option>

Don't know why I didn't think of that before. :S
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.

Forum Jump:

Users browsing this thread: 1 Guest(s)