JavaScript and client side scripting.
Moderator: General Moderators
maciek4
Forum Commoner
Posts: 29 Joined: Tue Apr 04, 2006 8:17 am
Post
by maciek4 » Thu Apr 27, 2006 3:11 am
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' : ''; ?>> A - du¿y<br>
<INPUT TYPE="checkbox" NAME="progress[B]" value="like" <? echo isset($progress['B']) ? 'checked' : ''; ?>> B<br>
<INPUT TYPE="checkbox" NAME="progress[C]" value="exam" <? echo isset($progress['C']) ? 'checked' : ''; ?>> C<br>
<INPUT TYPE="checkbox" NAME="progress[D]" value="exam" <? echo isset($progress['D']) ? 'checked' : ''; ?>> D - ma³y<br>
</td>
shiznatix
DevNet Master
Posts: 2745 Joined: Tue Dec 28, 2004 5:57 pm
Location: Tallinn, Estonia
Contact:
Post
by shiznatix » Thu Apr 27, 2006 3:51 am
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.
JayBird
Admin
Posts: 4524 Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:
Post
by JayBird » Thu Apr 27, 2006 4:18 am
Moved to Client Side
pickle
Briney Mod
Posts: 6445 Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:
Post
by pickle » Thu Apr 27, 2006 9:43 am
~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.