Meaningless Drivel is fun!*
The moose likes HTML, CSS and JavaScript and the fly likes how do I validate a listbox Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "how do I validate a listbox" Watch "how do I validate a listbox" New topic
Author

how do I validate a listbox

ushank
Greenhorn

Joined: Aug 04, 2003
Posts: 6
I want to validate a listbox by writing a small javascript which will not allow duplicate values inside it,and should pop an alert box when tried to duplicate, could anyone tell me how to go about with a sample javascript code.
Thanks
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Duplicate values? give me an example if you can.
ushank
Greenhorn

Joined: Aug 04, 2003
Posts: 6
I enter a store number into the list box like 1001,1002 1003 and later I try to renter 1001 through a text box then I should be able to stop it with a alert box.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61768
    
  67

Sounds like a fairly straight-forward matter of programming to me.
Have you tried to write any code yet? What has you stumped?
bear


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
ushank
Greenhorn

Joined: Aug 04, 2003
Posts: 6
well I'm new to scripting never tried so I need some sample kick off where I can grap and pick up my skills.
Sorry
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
You would have to compare the values of the select with the values of the text box.
How are the values of the select populated? Hard Coded, from an array, from a database?
Eric
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how do I validate a listbox