![]() |
![]() |
![]() |
|||||
![]() |
![]() |
![]() |
![]() |
![]() |
|||
| Welcome
to Tech Support Forum home to more then 136,000 problems solved. Issues
have included: Spyware, Malware, Virus Issues, Windows, Microsoft,
Linux, Networking, Security, Hardware, and Gaming Getting your
problem solved is as easy as: 1. Registering for a free account 2. Asking your question 3. Receiving an answer Registered members: * See fewer ads. * And much more..
|
| Want to know how to post a question? click here | Having problems with spyware and pop-ups? First Steps |
|
|||||||
| Web Design & Programming Discussion of web design, and server-side & client-side scripting |
![]() |
|
|
LinkBack | Thread Tools |
|
|
#1 (permalink) |
|
Troubled
Join Date: May 2009
Posts: 71
OS: Computer = WXP, Server = linux w/ php 5
|
Re: Javascript Validation On Multiple Select Lists
i couldn't find any errors
try testing it out on www.htmledit.squarefree.com |
|
|
|
| Important Information |
|
Join the #1 Tech Support Forum Today - It's Totally Free!
TechSupportForum.com is a leading support website for your computer needs. We offer free, friendly and personalized computer support. Why pay to have your computer fixed when you can do it for free. Join TechSupportforum.com Today - Click Here |
|
|
#2 (permalink) |
|
Troubled
Join Date: May 2009
Posts: 71
OS: Computer = WXP, Server = linux w/ php 5
|
Re: Javascript Validation On Multiple Select Lists
<html>
<head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <script> var minNum=1; var maxNum=3; function checkListBoxSize(){ oSelect=document.getElementById("category_id"); var count=0; for(var i=0;i<oSelect.options.length;i++){ if(oSelect.options[i].selected) count++; if(count>maxNum){ alert("Can't select more than 3"); return false; } } if(count<1){ alert("Must select at least one item"); return false; } return true; } </script> </head> <body> <form onsubmit="return checkListBoxSize()"> <select multiple="multiple" id="category_id" name="category_id" size="10" onchange="return false;"> <option value="a">a</option> <option value="b">b</option> <option value="c">c</option> <option value="d">d</option> <option value="e">e</option> <option value="Other">Other</option> </select> <input name="" type="submit"/> </form> </body> </html> i got that for you |
|
|
|
|
|
#4 (permalink) |
|
Manager, Microsoft Support
Join Date: Jul 2002
Location: Knoxville, TN or Austin, TX depending
Posts: 7,038
OS: WinXP Pro SP3 and Windows 7
|
Re: Javascript Validation On Multiple Select Lists
It appears the OP was a bot of some sort, it has been dealt with. Thank you for trying to help though.
__________________
![]() ![]() If TSF has helped you, Tell us about it! or Donate to help keep the site up! I do not subscribe to threads, so if I stop replying, PM me with a link to your thread so I can find it again. |
|
|
|
![]() |
| Thread Tools | |
|
|