How to make checkboxes explicit

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
maciek4
Forum Commoner
Posts: 29
Joined: Tue Apr 04, 2006 8:17 am

How to make checkboxes explicit

Post by maciek4 »

I have 4 checkboxes and I can check all 4 of them, but my goal is to make them explicit. If I check for example A and then decide to change my mind and select B then A will be unselected, but I dont know how to do suck a thing. :bemused:

Code: Select all

<td bgCOLOR="#E0E0E0" class="tah11" align=left>
<INPUT TYPE="checkbox" NAME="progress[A]" value="work" <? echo isset($progress['A']) ? 'checked' : ''; ?>>&nbsp;A - du¿y<br>
<INPUT TYPE="checkbox" NAME="progress[B]" value="like" <? echo isset($progress['B']) ? 'checked' : ''; ?>>&nbsp;B<br>
<INPUT TYPE="checkbox" NAME="progress[C]" value="exam" <? echo isset($progress['C']) ? 'checked' : ''; ?>>&nbsp;C<br>
<INPUT TYPE="checkbox" NAME="progress[D]" value="exam" <? echo isset($progress['D']) ? 'checked' : ''; ?>>&nbsp;D - ma³y<br>

</td>
User avatar
shiznatix
DevNet Master
Posts: 2745
Joined: Tue Dec 28, 2004 5:57 pm
Location: Tallinn, Estonia
Contact:

Post by shiznatix »

use a radio button instead and give all the fields the same name with a different value?

but if you have to use checkboxes you are going to have to use a javascript onclick thing.
User avatar
JayBird
Admin
Posts: 4524
Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:

Post by JayBird »

Moved to Client Side
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Post by pickle »

~shiznatix hit the nail on the head.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Post Reply