How do you submit a form using JavaScript?



How do you submit a form using JavaScript?..

Answer / Sanjay Gupta

To submit a form programmatically in JavaScript, you can use the `submit()` method on the form object: document.getElementById("myForm").submit(); or event.preventDefault(), then manipulate the form data and simulate a click on the form's submit button with event.target.click().

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More JavaScript Interview Questions

What are the string methods?

1 Answers  


What is the naming conventions for the variables in javascript?

1 Answers  


What is event in javascript?

1 Answers  


Methods get and post in html forms - what's the difference?

1 Answers  


What is shift() method in javascript?

1 Answers  


how can we generate alert message without referashing page in asp.net with language vb.net and script use in java script .means with out referash the page message in java alert

0 Answers   NIC,


What is event bubbling in the dom?

1 Answers  


What is event target in javascript?

1 Answers  


What is rest parameters in javascript?

1 Answers  


Are javascript variables global?

1 Answers  


How can JavaScript be used?

1 Answers   Deloitte, JPMorgan Chase,


Where do I write javascript code?

1 Answers  


Categories