By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,223 Members | 1,371 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,223 IT Pros & Developers. It's quick & easy.

Validation problem with select object using multiple attribute

P: n/a
Hi!

I'm using JavaScript on an HTML page for form validation. I have a
form value (theForm.ProdType1) which represents a picklist from which
users may make multiple selections; essentially, this is a Select
object with the "multiple" attribute. There are 20 options to choose
from in this object; one of the options (we'll call it option X)
should NEVER be selected with any other option in the object. Let's
say that the user has selected two options, and one of the options is
option X; how can I alert the user that this is not allowed? I'm not
sure how to identify option X's value out of all the values that have
been selected by the user, if the user has made two or more selections
from the picklist.

Thanks!
Griff
Jul 23 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Griff wrote:
I'm using JavaScript on an HTML page for form validation. I have a
form value (theForm.ProdType1)
document.forms['theForm'].elements['ProdType1']
which represents a picklist from which
users may make multiple selections; essentially, this is a Select
object with the "multiple" attribute. There are 20 options to choose
from in this object; one of the options (we'll call it option X)
should NEVER be selected with any other option in the object. Let's
say that the user has selected two options, and one of the options is
option X; how can I alert the user that this is not allowed? I'm not
sure how to identify option X's value out of all the values that have
been selected by the user, if the user has made two or more selections
from the picklist.


Modify the HTML to correspond with the task that it is to perform. You
have one item that, if selected, excludes all others. That is a pair of
radio buttons: "The Item", or: "Choose Items From the List", the other
items go in the select list and the select list is ignored when the "The
Item" radio button is selected. Users will understand clearly designed
and labelled forms.

Richard.
Jul 23 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.