FORM and 3 buttons. How to make goto URL
Moderator: General Moderators
FORM and 3 buttons. How to make goto URL
There is a FORM, INPUT type="text". And there are three buttons. Kindly ask you to help with this: after you put some info to the form, you push one button and you go to one URL. If you push another button, you go to different URL. And if you push the third button you go to the third different URL. But the info for this goto is taken from the INPUT type="text" form. It is 5-7 figures that are added to the URL after "?". It looks like that: http://www.somesite.com/archive.php?idx= and here is the info from the form.
Re: FORM and 3 buttons. How to make goto URL
What is your form Action and Method?
- AbraCadaver
- DevNet Master
- Posts: 2572
- Joined: Mon Feb 24, 2003 10:12 am
- Location: The Republic of Texas
- Contact:
Re: FORM and 3 buttons. How to make goto URL
You have two choices that I can think of:phpuse wrote:There is a FORM, INPUT type="text". And there are three buttons. Kindly ask you to help with this: after you put some info to the form, you push one button and you go to one URL. If you push another button, you go to different URL. And if you push the third button you go to the third different URL. But the info for this goto is taken from the INPUT type="text" form. It is 5-7 figures that are added to the URL after "?". It looks like that: http://www.somesite.com/archive.php?idx= and here is the info from the form.
First, each button needs an onclick that calls a javascript function passing the proper URL. The function needs to set the form action to the URL passed by the button and then submit.
Second, since it looks like you are using get instead of post, you can submit to one PHP page that collects the form data and then redirects to the proper page based upon which submit button was clicked (name).
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.