Darkness Soul Posted March 21, 2006 Share Posted March 21, 2006 Yo guys,Well, new problem.. how I need to do to make a check all option?My form is like a security form..each cheackbox have an unique name.. like "read_a" and "write_h"..[code]module A [_]read [_]writemodule B [_]read [_]writemodule C [_]read [_]write(...)module V [_]read [_]writemodule X [_]read [_]writemodule Z [_]read [_]writeAll Mods [_]read [_]write[/code]"simple" like that..^~ Thank you so much for any help..Soul Quote Link to comment https://forums.phpfreaks.com/topic/5433-check-uncheck-all/ Share on other sites More sharing options...
kenrbnsn Posted March 21, 2006 Share Posted March 21, 2006 Check All boxes are usually controlled via Javascript.Ken Quote Link to comment https://forums.phpfreaks.com/topic/5433-check-uncheck-all/#findComment-19421 Share on other sites More sharing options...
redbullmarky Posted March 21, 2006 Share Posted March 21, 2006 [!--quoteo(post=357050:date=Mar 21 2006, 07:10 PM:name=kenrbnsn)--][div class=\'quotetop\']QUOTE(kenrbnsn @ Mar 21 2006, 07:10 PM) [snapback]357050[/snapback][/div][div class=\'quotemain\'][!--quotec--]Check All boxes are usually controlled via Javascript.Ken[/quote]yep, this belongs in the javascript forum, but this is a little function that does what youre after. just use something like: onClick='check(document.form1.myfield)' whereas myfield is the name and id of all of your checkboxes:[code]var checkflag = "false";function check(field) { if (checkflag == "false") { for (i = 0; i < field.length; i++) { field[i].checked = true; } checkflag = "true"; } else { for (i = 0; i < field.length; i++) { field[i].checked = false; } checkflag = "false"; }}[/code] Quote Link to comment https://forums.phpfreaks.com/topic/5433-check-uncheck-all/#findComment-19427 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.