Re: textfield vaules not accessable??

From: Date: Tue, 29 Aug 2000 17:22:34 +0000
Subject: Re: textfield vaules not accessable??
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-14184@lists.php.net to get a copy of this message
On Tue, 29 Aug 2000, cisman raage wrote: > I generate textfields in a loop. The textfields have > initial vaules. Then the user can edit the values. The > problem is when I cannot get the values after the user > edited the textfields. I am using something like this > to generate the textfields in the loop: > > for($i = 0; $i < $loop_count; $i++){ > <input type='text' > name='fields:$group_id:topic_id[$i]' value='$grade'> > } > > I have another function that needs to get the values > from this form and I cannot do it. Any ideas?? Please > help. Hi Isman, Well, I don't think you can have "fields:$group_id:topic_id[$i]" as the name of your textfield. If you do that, your script that gets the result of this form will have a variable called $fields:17:topic_id[1], which is ilegal. Try nameing it diferently, like : for ($i = 0; $i < $loop_count; $i++) { echo "<input type='text' name='fields_" . $group_id . "_topic_id[]' value='$grade'>\n"; } I just noticed that you didn't have the echo function or print or whatever inside that loop. Maybe that's the error ? It is still broken because of your input field name anyway. You can then on the next script call the values of the textfields like this: for ($i = 0; $i < $loop_count; $i++) { echo $fields_groupidnumber_topic_id[$i] . "<BR>\n"; } I hope that helps ya. Regards, Joao -- Joao Prado Maia Web Developer Kefta.com, Inc

« previous php.general (#14184) next »