note 43949 added to language.variables.external

From: Date: Fri, 09 Jul 2004 18:42:51 +0000
Subject: note 43949 added to language.variables.external
Groups: php.notes 
Request: Send a blank email to php-notes+get-72929@lists.php.net to get a copy of this message
When dealing with multiple select boxes and the name=some_name[] so that PHP will understand that is needs to interpet the input as an array an not as a single value. If you want to access this in Javascript you should assign an id attribute to the select box as well as the name attribute. Then proceed to use the id attribute in Javascript to reference the select box and the name attribute to reference the select box in PHP. Example <select multiple id="select_id" name="select_name[]"> .... </select> <?PHP echo $select_name[0]; ?> <script language="javascript"> document.forms[0].select_id.options[0].selected = true; </script> I hope you get the idea ---- Manual Page -- http://www.php.net/manual/en/language.variables.external.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+43949 Delete -- http://master.php.net/manage/user-notes.php?action=delete+43949&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+43949&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#72929) next »