Jegan-S / dropdown-check-list

Automatically exported from code.google.com/p/dropdown-check-list
0 stars 0 forks source link

get the text of selected check box #258

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Hi,

   How can i get the text of all check boxes which are checked only.
I am using this code,but using i can get the id's of the selected check 
boxes.But i need to get the text of the selected item.

for (i = 0; i < selector.options.length; i++) {
                    if (selector.options[i].selected && (selector.options[i].value != "")) {
                        if (values != "") values += ";";
                        values +=selector.options[i].value;
                    }
alert(values );
                }

Original issue reported on code.google.com by maheswar...@gmail.com on 24 Jul 2012 at 10:57

GoogleCodeExporter commented 8 years ago
Hi,

   I solved it.By
for (i = 0; i < selector.options.length; i++) {
                    if (selector.options[i].selected && (selector.options[i].value != "")) {
                        if (values != "") values += ";";
                        values +=selector.options[i].innerHTML;
                    }
alert(values );

Original comment by maheswar...@gmail.com on 24 Jul 2012 at 12:49

GoogleCodeExporter commented 8 years ago
Glad you worked it out.

Original comment by womohun...@ittrium.com on 24 Jul 2012 at 2:19