Topic: Finding number of options selected in multiple choice Pages that link to <a href="https://ozoneasylum.com/backlink?for=30939" title="Pages that link to Topic: Finding number of options selected in multiple choice" rel="nofollow" >Topic: Finding number of options selected in multiple choice\

 
Author Thread
Nimmala
Obsessive-Compulsive (I) Inmate

From:
Insane since: Feb 2009

IP logged posted posted 04-02-2009 10:42 Edit Quote

Hi i want to know how we can find out number options selected in multiple choice button.

DavidJCobb
Nervous Wreck (II) Inmate

From:
Insane since: Mar 2009

IP logged posted posted 04-02-2009 20:55 Edit Quote

Multiple-choice button as in a set of checkboxes? Or as in a SELECT element that allows multiple selections?

----------------------

poi
Paranoid (IV) Inmate

From: Norway
Insane since: Jun 2002

IP logged posted posted 04-02-2009 23:16 Edit Quote

and you didn't think that this was a sloved problem and the solution was already all over the interNets ?

yossiadmon
Obsessive-Compulsive (I) Inmate

From: Israel
Insane since: Sep 2009

IP logged posted posted 09-08-2009 14:00 Edit Quote

I assume you are talking about SELECT item (you mentioned "options")

code:
function countSelectedItems(id){
              var opts=document.getElementById(id).options;
              var ret=0;
              for(var i=0;i<opts.length;i++) 
                  ret+=(opts[i].selected)?1:0;
              return ret;
          }

coach
Nervous Wreck (II) Inmate

From:
Insane since: May 2011

IP logged posted posted 05-31-2011 11:04 Edit Quote
Edit TP: spam removed


Post Reply
 
Your User Name:
Your Password:
Login Options:
 
Your Text:
Loading...
Options:


« BackwardsOnwards »

Show Forum Drop Down Menu