Answers for "form action javascript"

3

put form action jquery

$('#button1').click(function(){
   $('#formId').attr('action', 'page1');
});


$('#button2').click(function(){
   $('#formId').attr('action', 'page2');
});
Posted by: Guest on November-03-2020
0

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
Posted by: Guest on July-06-2021
1

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>
Posted by: Guest on July-12-2021
0

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>
Posted by: Guest on June-11-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language