Jump to content

[SOLVED] Changing Form - Problem


paulman888888

Recommended Posts

I have my form and the form changes everytime.

The form may have 12 textareas or something 24.

 

What I would like to know is how do i collect all data from all text area into 1 string?

heres my form

<?php 
//this is the important part
for ($i=1; $i<=$moves; $i++)//the $moves will change all the time
{
echo'<tr><td width="50%"><span id="sprytextfield1"><label>
      '.$i.') <input name="white_move_'.$i.'" type="text" id="white_move_'.$i.'" size="9"></label>
      <span class="textfieldRequiredMsg">A value is required.</span><span class="textfieldMinCharsMsg">Please Enter Whites Move.</span></span></td>';
echo'<td width="50%"><span id="sprytextfield2">
      <label><input name="black_move_'.$i.'" type="text" id="black_move_'.$i.'" size="9">
      </label>
      <span class="textfieldRequiredMsg">A value is required.</span><span class="textfieldMinCharsMsg">Please Enter Blacks Move</span></span></td></tr>';
}

On my collection page where all infomation is sent.

How would i retieve all the form information?

I would like to collect the results like this.

(number). (value of white_move_#) (value of black_move_#)

# will change all the time.

 

I hope i didnt sound to confuseing.

Thankyou

Paul

Link to comment
https://forums.phpfreaks.com/topic/118700-solved-changing-form-problem/
Share on other sites

This is one way of doing it, however not very efficient.

<?php
$textareas = $_POST['textarea1'] . $_POST['textarea2'] . $_POST['textarea3'];

echo $textareas;

 

Good idea but like i said there wont be a sent number of textareas.

There may be 4 sometime and 66 other times.

So i think i need some kind of loop to find out how many textareas i have got and then use your code.

Hope you understand

 

Thankyou

Paul

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.