note 21739 added to language.types.array

From: Date: Fri, 24 May 2002 22:06:40 +0000
Subject: note 21739 added to language.types.array
Groups: php.notes 
Request: Send a blank email to php-notes+get-31010@lists.php.net to get a copy of this message
For all of you having problems when using php arrays in an HTML form input field name, and wanting to validate the form using javascript for example, it is much easier to specify an id for the field as well, and use this id for validation. Example: <input type="text" id="lastname" name="fields[lastname]"> then in the javascript check: if(formname.lastname.value == "") { alert("please enter a lastname!"); } This works very well. If you have any problems with it, let me know. -- http://www.php.net/manual/en/language.types.array.php http://master.php.net/manage/user-notes.php?action=edit+21739 http://master.php.net/manage/user-notes.php?action=delete+21739 http://master.php.net/manage/user-notes.php?action=reject+21739

« previous php.notes (#31010) next »