Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Validation problem with select object using multiple attribute

Reply
Thread Tools

Validation problem with select object using multiple attribute

 
 
Griff
Guest
Posts: n/a
 
      04-13-2004
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
 
Reply With Quote
 
 
 
 
Richard Cornford
Guest
Posts: n/a
 
      04-13-2004
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.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[XSLT] Select node by attribute with value from an attribute of its self Stefan_W XML 1 11-05-2008 10:50 AM
Validation (XHTML 1.0 Transitional): Attribute 'height' is not a valid attribute of element 'table' perspolis ASP .Net 1 01-23-2007 07:57 AM
Validation (XHTML 1.0 Transitional) - Attribute..... is not a valid attribute of..... Radu ASP .Net 2 01-03-2007 03:41 PM
Validation (XHTML 1.0 Transitional): Attribute 'leftmargin' is not a valid attribute of element 'body'. anonymous ASP .Net 1 08-02-2006 08:05 AM
select of select box will select multiple in another box palmiere Javascript 1 02-09-2004 01:11 PM



Advertisments