The JavaScript function would be like the following − We can use it to dynamically create and send our own forms to server. preventDefault in Practice. The method form.submit() allows to initiate form sending from JavaScript. event.preventDefault() Returns: undefined Description: If this method is called, the default action of the event will not be triggered. Our J a vaScript, like our HTML, also consists of three parts:. A fileUpload function to trigger the click event on the file upload input. Calling preventDefault() for a non-cancelable event … In this post, we will see how to disable submit button on form submission with JavaScript and jQuery. Note that the submit event fires on the element itself, and not on any