I have an HTML form that calls a PHP function as:
<form action="test.php" method "get">
user data..
user data
</form>
Now I want to change the functionality as:
User enters 'yes' : Goto test1.php
User enters 'no' : Goto test2.php
As this I could not find a way to directly achieve this via HTML. I called javascript from HTML as:
<\input type ="button" onclick="myfunction()" value="submit"/>
In the myfunction()
call,
I take inputs of the form using
var = document.getElementById('data').value
Now Once user input is parsed. I want to take take all the form data and pass it to a PHP file like:
if var==yes:
action="test1.php" method="get"
if var==no:
action="test2.php" method="get"
I have browsed through other answers which suggest Ajax calls. Can it be done without Ajax calls ?