Form action to self and other page
Posted: Mon Sep 08, 2014 4:53 am
hi,
How can i make a <form> have 2 submit buttons, and make 1 to go to the same page (like action="", or phpself, whatever works.)
and the other submit button to an other page (like action="otherpage.php").
They both have to take the data from the input field ofcourse.
I found on the internet to try use functions like this:
<form action='default.php'>
<button onclick='updateform()' value='edit'/>
<button onclick='submitform()' value='delete'/>
</form>
function updateform() {
$('form').action = 'editaction.php';
$('form').submit();
}
function submitform) {
$('form').action = 'deleteaction.php';
$('form').submit();
}
but when i run it, i just get a blank page.
Hope someone can help me.
Thanks in advance.
How can i make a <form> have 2 submit buttons, and make 1 to go to the same page (like action="", or phpself, whatever works.)
and the other submit button to an other page (like action="otherpage.php").
They both have to take the data from the input field ofcourse.
I found on the internet to try use functions like this:
<form action='default.php'>
<button onclick='updateform()' value='edit'/>
<button onclick='submitform()' value='delete'/>
</form>
function updateform() {
$('form').action = 'editaction.php';
$('form').submit();
}
function submitform) {
$('form').action = 'deleteaction.php';
$('form').submit();
}
but when i run it, i just get a blank page.
Hope someone can help me.
Thanks in advance.