473,468 Members | 1,371 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Validation problem with select object using multiple attribute

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
1 2603
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Rolf Wester | last post by:
Hi, I have a form with a select element with multiple="true". When using the GET method (I suppose the same happens with the POST method) I can seen that the form sends channels=CH1&channels=CH2...
2
by: Frank Py | last post by:
I'm tring to use a validation function example from WROX that looks at form fields on a submit. I can't seem to launch it. I have 2 other functions up in the header that work fine. Any help...
21
by: AnnMarie | last post by:
<script language="JavaScript" type="text/javascript"> <!-- function validate(theForm) { var validity = true; // assume valid if(frmComments.name.value=='' && validity == true) { alert('Your...
8
by: Calan | last post by:
I have a server-side ASP script that dynamically creates an input form from a database table. The table contains a field name, the table where values are stored, type of input control, value for a...
4
by: jedimasta | last post by:
Good evening all, I'm a relatively new to javascript, but I've been working with ColdFusion and PHP for years so I'm not necessarily ignorant, just stuck and frustrated. Using ColdFusion I'm...
5
by: paul_zaoldyeck | last post by:
does anyone know how to validate an xml file against multiple defined schema? can you show me some examples? i'm making here an xml reader.. thank you
11
by: Rik | last post by:
Hello guys, now that I'm that I'm working on my first major 'open' forms (with uncontrolled users I mean, not a secure backend-interface), I'd like to add a lot of possibilities to check wether...
0
by: tanish2k | last post by:
hi. I am using c#, visual studio 2003. I need to validate a xml file against schema which itself has 2 more schema imported under it. i have following 2 xsd files : xsd1 --->...
8
by: Bryan | last post by:
I want my business objects to be able to do this: class Person(base): def __init__(self): self.name = None @base.validator def validate_name(self): if not self.name: return
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.