|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Need code for two buttons and one text box
How do I set up an html form to do the following:
One one form there is one text box and two radio buttons in a group. Selecting one button sends the text box string to one php form, and pressing the other button sends a strong to another php form. More specifically, I need code for two radio buttons and one text box to do the following. When radio button 1 is selected I want to take the text in the text box and send the text in a string via a url to my php database display page called Display1.php. When radio button 2 is selected then take the text in the text box and send the text in a string via a url to my php database display page called Display2.php. Another method would be to have two submit buttons and have each of the submit buttons send the users input to a different page. I have searched all over the net for this solution but found nothing. Normally, only one form is called rather than having two or more forms called using one text box. |
|
#2
|
||||
|
||||
|
There are two possible solutions.
Use javascript to redirect to two seperate pages, or submit the form to a routing-type page which will pass the information on to the final pages based on the value of the radio button. Now, if the user has Javascript disabled, the first method obviously won't work. However, the first method is a little more direct whereas you don't need to create a new PHP to simply route the data. I'm not too keen on making this for you as I'm sure you're capable of doing it yourself. But hopefully these hints will be of some help. |
![]() |
| Viewing: Dev Articles Community Forums > Programming > PHP Development > Need code for two buttons and one text box |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|