Jump to content

textbox values


chestnuth

Recommended Posts

Hi guys,

 

I have a bit of a problem with reading values out of a text box, any help would be great!

 

The while loops goes through a db table and passes out all the rows onto a form. Each row is a question that i need a answer from the user for so there is a text area associated with each question. like this:

 

<?php while($rowactivequestions=mysql_fetch_array ($resultactivequestions))

{

            $textareaid='Q'.$rowactivequestions['qid'];

$names.=$textareaid.' ';

            echo $rowactivequestions['question'];

echo '<br />'."\n";

echo '<textarea name="'.$textareaid.'" rows="5" cols="70">Answer.</textarea>'."\n";

echo '<input type="type" name="thenames" value="'.$names.'"/>'."\n";

echo '<br />'."\n";

echo '<br />'."\n";

}

?>

 

As the questions id's could be different every time the form loads i need to insert the question number and also the associated answer (from textarea) into the database.

As you can see the second input is where i am storing the question id values from the database, it looks something this at the moment (Q1, Q2, Q3, Q5) question 4 is missing as it does not satisfy the query that produces the list of questions.

 

how can i get each value (question id) from the textbox and also each answer from the text area and insert them to the database?

 

This has been annoying me for weeks.

 

any help would be great

 

Thanks

J

 

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.