473,812 Members | 2,859 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how would i validate this select box using javascript

1 New Member
How would I validate this select box using JavaScript?

Expand|Select|Wrap|Line Numbers
  1. <form action="pizza/data.php" method="post" name="form" 
  2.           onsubmit="javascript:return form_validation();"/>
  3.  
  4. <select name="team[]" id="s" multiple="multiple">
  5. <option value="sox" name="one">sox</option>
  6. <option value="celtics" name="two">celtics</option>
  7. <option value="patriots" name="three">patriots</option>
  8. </select>
  9.  
  10. </form>
Apr 28 '11 #1
1 2133
acoder
16,027 Recognized Expert Moderator MVP
What kind of validation? That at least one option should be selected?
May 12 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
1893
by: guitarsajee | last post by:
hi.. i want to know how to validate file tag using javascript... plz let me know soon as possible.. thanx...
0
1393
by: First_step_to_xml | last post by:
Hi All, I am trying to take an xml file as input from user and update the sql database with this new data from the xml file. Before going to the step of updating the data in the database, i want to validate this xml file with the xml schema file that i have, to make sure that the user has indeed provided a correctly formed xml, and that
1
5068
by: vehuel | last post by:
I have a select multiple (combobox) in a form and I need to select, using javascript, more than one item in this select. How can I do this?
2
8426
by: simon.wilkinson | last post by:
Hi, I am trying to update all Select boxes on a page dynamically using javascript, I simple want to change the selected item in each select box when a tick box is pressed on the page. Each Select box is named in the same convention ie. ddl_DeliveryStatus_ and then the recordID and contains the same options in the same order. The number of select boxes changes every time the page is loaded as this is all built using ASP linked to a...
2
2175
by: nbt725 | last post by:
Dear Sir, Hello ! I need to validate my login form which is displayed using <div> to give sliding effect and not to refresh page, hence can't use generic php submit but to validate using javascript and/or ajax. And in log in form I need to validata user id and password to my mysql database. Please guide me. Thanks & Regards, Naimesh Trivedi
1
2483
by: saurabhswati722 | last post by:
My Urgent question : How to validate textfield using Javascript in PHP?
1
9937
by: mishasoft | last post by:
Hi all, I have a HTML multiple select (ListBox) control: <select id="mySelect" multiple> <option>Apple</option> <option>Orange</option> <option>Pineapple</option> <option>Banana</option> </select>
3
9865
by: zac540 | last post by:
Hey everyone! First of all I'd like to say that I did my best to look for any other relevant posts. The best I found was this interesting thread.. http://bytes.com/forum/thread594982.html If it answered my question I am just to stupid to realize it I would like to apologize in advance. This is my very first attempt at using Javascript so any help at all is greatly appreciated. I read the W3Schools Tutorial on Javascript so that and some...
8
4941
by: GiJeet | last post by:
hello, is it possible to determine the browser and version using javascript at runtime and apply a browser specific external .css file? If so, I'd appreciate code sample so I can see how it's done. TIA G
0
9607
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10401
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10416
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9217
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7676
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5567
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5704
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4357
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 we have to send another system
2
3881
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.