---
title: "How do you submit a form using Javascript?"  
description: "How do you submit a form using Javascript?"  
author: "Anonymous User"  
published: 2011-05-18  
updated: 2020-09-18  
canonical: https://www.mindstick.com/interview/946/how-do-you-submit-a-form-using-javascript  
category: "javascript"  
tags: ["javascript"]  
reading_time: 1 minute  

---

# How do you submit a form using Javascript?

Use document.forms[0].submit();\
(0 refers to the index of the form – if you have more than one form in a page, then the first one has the index 0, second has index 1 and so on).

## Answers

### Answer by Anonymous User

Use document.forms[0].submit();\
(0 refers to the index of the form – if you have more than one form in a page, then the first one has the index 0, second has index 1 and so on).


---

Original Source: https://www.mindstick.com/interview/946/how-do-you-submit-a-form-using-javascript

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
