answersLogoWhite

0


Best Answer

Once you submit a form you can use the $_POST[] array to grab the data from a form with PHP. You can then use this data to insert it into a form. Here is an example:

<?php

if($_POST['submit']){

$text_box_contents = $_POST['comments'];

echo ' <select> <option>'.$text_box_contents .'</option> </select>';

}else{

echo ' <form method="post" action="$_SERVER['self']">

<textarea name="comments" cols="40" rows="5">

hostmysite.com

Enter your comments here...

</textarea><br>

<input type="submit" value="Submit" /> </form>';

}

?>

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Php code to insert value from textbox into dropdownlist?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How to display the text box value in another form using VB.NET?

You can display a textbox value in another form using Vb.NET. Simply by inputing this line of code:'You can put this code anywhere under a Private Sub or Sub''I Will use an example of a textbox named "testabc" and "othertextacbcTestAbc.Text = frmMain.OtherTextAbc.Text'You can replace the "frmMain with the form you are trying to access.


How do you insert a HTML text box in a flash website how to insert HTML text box code in empty text box?

The textarea tag is a part of the form tag and is contained within that and the fieldset tags. A textbox is produced by an inline or external JavaScript.


What code can I use to change the color controls of a textbox?

//in C#, this color setups color with black textbox.BackColor = Color.Black;


Where do you insert the dofus code?

kamas code


How do you install code in the browser?

Some web browsers will allow code insertion and some will not. The ability to insert code depends on what browser you have and why you want to insert code into it.


What is the code for inputting a username in a textbox in visual basic 2008 in a form so that it can accept someone to use that form?

You don't need any coding to do this. Instead you can make a label and a textbox and the user can automatically enter text into the box as long as read only is set to false.


What code would let you only use a textbox if something in it?

What exactly are you asking? Are you asking, how can I make a textbox enabled only if there is a word in it.. But how would you type a word in a disabled textbox? If TextBox1.Text.Contains("Hello") Then 'Type the word you want here Button1.Enabled = True 'what you want to happen if textbox1.text contains the word End If All the means is if the word hello is in textbox1 then you can click button1..


What is cprogram code to insert a node in single link list?

Write Code to Insert a Node in a Single Linked List at any given Position.


How do you insert a picture from netbeans 6.5?

By using the html code we can able to insert the imagein netbeans.


How do you insert a code in Pokemon diamond?

ummm really simple you gust go to the menu and press Add New Code and and insert the code and tada? umm pretty much everybody knows that.


What is the syntax for if statement in visual basic?

The basic structure of an IF statement in visual basic is as follows, including the ElseIf statement which allows you to nest IF statements far more easily than writing out the whole statement again. If &lt;Argument&gt; Then &lt;Code&gt; ElseIf &lt;Argument&gt; Then &lt;Code&gt; Else &lt;Code&gt; End If If you need a realistic example of this then take the following example, you have a form with three text boxes and a button, the following IF statement is executed on click of the button. If TextBox1.Text = TextBox2.Text Then MsgBox("Textbox 1 and 2 match") ElseIf TextBox1.Text = TextBox3.Text Then MsgBox("Textbox 1 and 3 match") Else MsgBox("No Textboxes match Textbox 1") End If


what is my deviantart verification code?

A verification code is a security protection method used by form owners to avoid Internet robots from abusing and spamming their web forms. ... A randomly generated code appears in an image above a textbox where the visitor has to type the exact code in order for the form data to be sent.