Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

javascript submit a form with id

// 1. Acquire a reference to our <form>.
//    This can also be done by setting <form name="blub" id="myAwsomeForm">:
//       var form = document.forms.blub;

var form = document.getElementById("myAwsomeForm");


// 2. Get a reference to our preferred element (link/button, see below) and
//    add an event listener for the "click" event.
document.getElementById("your-link-or-button-id").addEventListener("click", function () {
  form.submit();
});

// 3. any site in your javascript code:
document.getElementById('myAwsomeForm').submit();
Comment

PREVIOUS NEXT
Code Example
Javascript :: javascript round to nearest 10 
Javascript :: s3.getobject nodejs example async await 
Javascript :: Truncate a string-Javascript 
Javascript :: send xmlhttprequest with axios 
Javascript :: js toggle boolean 
Javascript :: create textbox using javascript 
Javascript :: how to wait until a variable is set javascript 
Javascript :: Mongoose - populate nested array 
Javascript :: javascript forever loop 
Javascript :: infinite loop in programming 
Javascript :: moment month start date and end date 
Javascript :: javascript string array sort alphabetically 
Javascript :: ... array operator javascript 
Javascript :: jQuery select elements by name 
Javascript :: electron js development auto refresh 
Javascript :: javascript how to know the end of the scroll 
Javascript :: sum row values in datatable jquery 
Javascript :: jquery reset form fields 
Javascript :: require is undefined 
Javascript :: How do I push an element into the array within an object in AngularJS 
Javascript :: expressjs swagger yaml 
Javascript :: nodejs format text 
Javascript :: react-bootstrap navbar nav link refreshes page 
Javascript :: how to detect onend reach of scrollview in react native 
Javascript :: Uncaught (in promise): NullInjectorError 
Javascript :: code Execution time in nodejs 
Javascript :: node get root directory 
Javascript :: transitionduration 
Javascript :: call function on modal open 
Javascript :: react native new line character 
ADD CONTENT
Topic
Content
Source link
Name
1+5 =