Re: Arrays and Textareas

From: Date: Wed, 13 Sep 2000 17:30:12 +0000
Subject: Re: Arrays and Textareas
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-16611@lists.php.net to get a copy of this message
Weston, Your input and textarea names are the same (tocElement). Try something like tocElement_input and tocElement_textarea to separate them. You can also 'force' the array to match, like this: inputs: tocElement_input[1] tocElement_input[2] tocElement_input[3] tocElement_input[4] tocElement_textarea[1] tocElement_textarea[2] tocElement_textarea[3] tocElement_textarea[4] The numbers can be generated by an index in a loop that you generate the number of fields with. On the submit page, when looping through the count of one array (either one), just use the same index number to get the value of the other array. BTW, I don't know if it hurts to use single quotes in HTML parameters, but I think it's good code to use doubles. Hans On Wed, 13 Sep 2000, Weston Houghton wrote: > > Hey, > > I'm trying to generate a dynamic number of input fields, each input field > with an associated textarea. If they were all input fields, I could throw > each field into an array. However, when I throw a textarea into the picture, > it seems to screw with the array elements. > > You can see this at: > http://mandalay.anapraxis.com/dev/adm_tocstart.php > > If you want to see the code, you can view any of the pages as *.txt > > I would appreciate any recommendations on how to approach this from here. > > Wes > > > > -- Hans Anderson -=- me@hansanderson.com | PHP, SQL Databases, Flash 5 Animation http://www.hansanderson.com | & Programming, Killer Audio Production, http://www.goofiness.com | Search Engines, Brewmeister.

« previous php.general (#16611) next »