View Full Version : combo box values?
11-30-2009, 03:25 PM
I have 2 combo boxes where you can move the items in combo box 1 to combo box 2. I want to validate that combo box 2 actually has something moved to it. How can I count the items in combo box 2. Combo box 2 will initially have no items in the box on page load. It is up to the user to move the items to combo box 2 and I want to make sure at least 1 item was moved.
11-30-2009, 09:58 PM
Or do you really mean you have simply a pair of <select>s???
If so, it's easy.
Just do something like this:
var found = false;
for ( var i = 0; i < form.two.options.length; ++i )
if ( form.two.options[i].selected ) found = true;
if ( ! found )
alert("You must choose at least one widget");
... other form validation here ...
return true; // if all validation succeeds
<form ... onsubmit="return validateForm(this);">
12-01-2009, 01:16 AM
How anybody suppose to help when "OldPend.." taking them all. Dang :p!!!
Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.