This is an example of how you can change a form action using Javascript.
Place two (or more) Radio Buttons in your form, as well as a submit button .
Right click the first Radio Button, and in the Inside Tag of it's html, paste the following code:
onclick="changeaction1()"
Repeat the operation with the second one, using this other code :
onclick="changeaction2()"
Now, go in the Page HTML and paste this other code in the Between head Tag:
<script language="JavaScript" type="text/javascript">
function changeaction1()
{
document.forms[0].action = 'http://www.dbtechnosystems.com' ;
}
function changeaction2()
{
document.forms[0].action = 'http://www.navaldesign.info' ;
}
</script>
You can see, in red, the URLs that i have used in this example, replace them with your own. If you have more than two radio buttons, add code accordingly.
Tips for Forms: Changing the Form Action with Javascript
Tips
You can use this trick either to change the Form action, and redirect to a specific proccessing script, OR you can use it as a navigation system
Date: 2024/11/24 |
Your IP Address: 3.147.86.246 |
Hosted by
One account:
Unlimited domains ,
Unlimited email accounts, Unlimited Databases,
and more....