One Form, Two Buttons = Two Diffrent Actions?, This must be possible, can someone help, thanks in advance! |
One Form, Two Buttons = Two Diffrent Actions?, This must be possible, can someone help, thanks in advance! |
lambokid |
May 9 2007, 02:59 PM
Post
#1
|
Group: Members Posts: 2 Joined: 9-May 07 Member No.: 2,773 |
Thanks for your time
I want one text box, with two buttons too perform two different actions. When i press one button i want it to search the site, and the other button to search google Here is a visual of what i want. This is what i have now..... CODE <form action="search.php" method="post"> <input class="search" onblur="if (value==''){value='Search DDLoogle';}" onfocus="if (value == 'Search DDLoogle') {value='';}" size="60" type="text" name="q" /> <br><input class="button" type="submit" value= "DDLoogle Search" name="submit" size="12" /> </form> |
Darin McGrew |
May 9 2007, 05:25 PM
Post
#2
|
WDG Member Group: Root Admin Posts: 8,365 Joined: 4-August 06 From: Mountain View, CA Member No.: 3 |
Please see the FAQ entry Can I have two or more Submit buttons in the same form?
|
lambokid |
May 9 2007, 07:53 PM
Post
#3
|
Group: Members Posts: 2 Joined: 9-May 07 Member No.: 2,773 |
okay i tried naming each button,
i searched google for a while, and 90% of the results says exactly that but i dont understand what the naming accomplishes. how is the names suppose to choose which action i want the form to perform? well i pulled something out of my ___ , this obviously does not work...fully. it automatically performs the first form action, whichever button i click CODE <form action="search.php" method="post" name="ddloogle"> <form action="http://www.google.com/custom" method="post" name="google"> <input class="search" size="60" type="text" name="q" /> <input type="submit" value="DDLoogle Search" name="ddloogle" /> <input type="submit" value="Google Search" name="google" /> </form> Example: (www.ddloogle.com/index2.php) im juts guessing this is impossible, because i also find on google, that a form with two actions is impossible..blahblahblah does anyone know anyway of helping me... i dont mind using another programming language, just name it.. |
Darin McGrew |
May 10 2007, 12:02 PM
Post
#4
|
WDG Member Group: Root Admin Posts: 8,365 Joined: 4-August 06 From: Mountain View, CA Member No.: 3 |
You need a single server-side program that processes the form data and decides what to do based on which submit button was used.
|
Lo-Fi Version | Time is now: 27th April 2024 - 01:25 AM |