Re: Arrays and Textareas
| From: | Weston Houghton | Date: | Wed, 13 Sep 2000 18:21:59 +0000 |
| Subject: | Re: Arrays and Textareas | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-16617@lists.php.net to get a copy of this message | ||
Perfect solution sitting right in front of me, thank you. Now a secondary
question though...
You can pass text fields through pages by just using hidden form fields,
does anyone have a recommendation on how to do this for textareas?
Thanks again,
Wes
>
> 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
>>
>>
>>
>>