It's not a secret anymore!
The moose likes HTML, CSS and JavaScript and the fly likes Problem While using check boxes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Problem While using check boxes" Watch "Problem While using check boxes" New topic

Problem While using check boxes

shyamkumar bopannachengalaiah
Ranch Hand

Joined: Dec 30, 2008
Posts: 100
Thanks for your suggestion . But the actual problem is that i have a five check boxes where first check box name is "all" and other four check box name is subject names and their values are different.when i click the " all " checkbox the other subjectname check boxes will be checked or it works finer when i have more than one subject name.but when i have single subject name and when i click the" all " check box it throws an error message as undefined i need help for check box having "all" check box and a single subjectname checkbox.

I am working on a application where i have five check boxes.First checkbox name is 'All' and name for other four checkboxes are 'Subjectname'. if i have a screen where all five checkboxes are displayed when i check in first check box i am getting no problems. but when i have a screen displaying only 'All' check box and single subjectname check box when i click check in 'All' checkbox i am getting a alert message as undefined can i solve this problem. i am using html and javascript.


function Check(tt)
for (i = 0; i < ; i++)
tt[i].checked = true ;

for (i = 0; i < y; i++)
tt[i].checked = false ;

<input type="checkbox" name="Check_ctr" value="yes"
<input type="checkbox" name="checkbox1" value="Subjectname1">

<input type="checkbox" name="checkbox1" value="Subjectname2">

<input type="checkbox" name="checkbox1" value="Subjectname3">

<input type="checkbox" name="checkbox1" value="Subjectname4">

<input type="checkbox" name="checkbox1" value="Subjectname5">

chsanthosh kumar
Ranch Hand

Joined: Jun 28, 2005
Posts: 56


however, you will find more examples in search...

---------------------<br />SCJP(1.4)With 95%<br /> <br />Do it Right and Forget it!
Eric Pascarello

Joined: Nov 08, 2001
Posts: 15385
It has been asked many times on this forum:

I agree. Here's the link:
subject: Problem While using check boxes
It's not a secret anymore!