PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old February 23rd, 2005, 07:25 AM
HowdeeDoodee HowdeeDoodee is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Posts: 14 HowdeeDoodee User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 50 m 18 sec
Reputation Power: 0
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.

Reply With Quote
  #2  
Old February 23rd, 2005, 07:44 AM
MadCowDzz's Avatar
MadCowDzz MadCowDzz is offline
I'm Internet Famous
Dev Articles Frequenter (2500 - 2999 posts)
 
Join Date: Jan 2003
Location: Toronto, Canada
Posts: 2,890 MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 1 Week 16 h 14 m 9 sec
Reputation Power: 8
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.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingPHP Development > Need code for two buttons and one text box


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT