put form action jquery
$('#button1').click(function(){
$('#formId').attr('action', 'page1');
});
$('#button2').click(function(){
$('#formId').attr('action', 'page2');
});
put form action jquery
$('#button1').click(function(){
$('#formId').attr('action', 'page1');
});
$('#button2').click(function(){
$('#formId').attr('action', 'page2');
});
How can I set the form action through JavaScript?
//Set your form action
document.getElementById('myFormId').action="./myPage.myLanguage"
//display on console your form action
connsole.log(document.getElementById('myFormId').action)
//retrive the action from a selected Form
document.getElementById('myFormId').action
form action in html
<!--Answer from W3 Schools-->
<form action="/action_page.php">
<label for="username">Username:</label>
<input type="text" id="username" name="username" required>
<input type="submit">
</form>
html form action javascript
<!-- use onsubmit -->
<form onsubmit="return yourJavaScript(this)">
<div>
<label>Name:</label>
<input id="name" name="name" type="text">
</div>
<div>
<label>Email:</label>
<input id="email" name="email" type="email">
</div>
<div>
<input id="submit" type="submit">
</div>
</form>
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us