| | |
I cann't unable to get count the selected list box items using javascript
Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
Try something like:
javascript Syntax (Toggle Plain Text)
/** * Alerts out the selected item values of a select box * * @author sos * @param {HTMLFormElement} frm The reference to the form element * @param {String} name The name of the select box */ function show(frm, name) { var selOpts = frm.elements[name].options; for(var i = 0, max = selOpts.length; i < max; ++i) { if(selOpts[i].selected) { alert("Selected Item: " + selOpts[i].value); } } }
Last edited by ~s.o.s~; Jan 2nd, 2008 at 11:30 am.
I don't accept change; I don't deserve to live.
Jo Tujhe Jagaaye, Nindein Teri Udaaye Khwaab Hai Sachcha Wahi.
Nindon Mein Jo Aaye Jise To Bhul Jaaye Khawab Woh Sachcha Nahi.
Khwaab Ko Raag De, Nind Ko Aag De
Jo Tujhe Jagaaye, Nindein Teri Udaaye Khwaab Hai Sachcha Wahi.
Nindon Mein Jo Aaye Jise To Bhul Jaaye Khawab Woh Sachcha Nahi.
Khwaab Ko Raag De, Nind Ko Aag De
![]() |
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: Send an image to an SWF
- Next Thread: FileUpload using ajax
| Thread Tools | Search this Thread |
Tag cloud for JavaScript / DHTML / AJAX
ajax ajaxexample ajaxjspservlets array autoplay blackjack browser captchaformproblem checkbox child class close codes date debugger dependent developer disablefirebug dom editor element embed engine events explorer ext file firefox flash form forms game gears getselection google gxt hiddenvalue highlightedword hint html ie7 ie8 iframe internet java javascript javascripthelp2020 jquery jsf jsfile jsp jump libcurl maps marquee masterpage math matrixcaptcha media mysql object onerror onmouseoutdivproblem onreadystatechange parent passing paypal pdf php player position post programming rated redirect runtime safari scriptlets scroll search security session shopping size software solutions sources star stars stretch synchronous tweet unicode variables web webkit webservice window wysiwyg \n






