note 34993 added to language.types.array

From: Date: Thu, 14 Aug 2003 13:05:13 +0000
Subject: note 34993 added to language.types.array
Groups: php.notes 
Request: Send a blank email to php-notes+get-54158@lists.php.net to get a copy of this message
Yet another way to use JavaScript to access form elements that use PHP's (ugly) way of getting arrays from browsers. This code specifically can be used to do things like have a "check all" link: <input type="checkbox" name="array1[]" value="a"> a <input type="checkbox" name="array1[]" value="b"> b <input type="checkbox" name="array1[]" value="c"> c <input type="button" value="Check/Uncheck All" onclick=" myset = getElementsByName('array1[]'); for (var i = 0; i < myset.length; i++) { myset[i].checked = !myset[i].checked; } "> Tested and working in Mozilla 1.4 Mac/PC, IE 5 Windows, IE 5 Mac, Safari, and iCab. ---- Manual Page -- http://www.php.net/manual/en/language.types.array.php Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+34993 Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+34993&report=yes Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+34993&report=yes

« previous php.notes (#54158) next »