This week's giveaway is in the Spring forum.
We're giving away four copies of Learn Spring Security (video course) and have Eugen Paraschiv on-line!
See this thread for details.
Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how do I validate a listbox

 
ushank
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Duplicate values? give me an example if you can.
 
ushank
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64613
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sounds like a fairly straight-forward matter of programming to me.
Have you tried to write any code yet? What has you stumped?
bear
 
ushank
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic