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
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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.