Jump to content

change form action in javascript


MDanz

Recommended Posts

when i click on a submit button it should take me to get.php but it doesn't whats wrong?

 

 <form enctype='multipart/form-data' action='' method='POST' name='form'>
<div id=$counter><input type='submit' name='webpage' value='Add Webpage' onClick='return changeAction1(this);' /></div>
</form>

 

<script type="text/javascript">
function changeAction1(form)
{
form.action = "get.php"
}
function changeAction2(form)
{
form.action = "insert9x.php"
}
function changeAction3(form)
{
form.action = "insert8x.php"
}
</script>

Link to comment
https://forums.phpfreaks.com/topic/201059-change-form-action-in-javascript/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.