Syntax onSubmit="command" The onSubmit method of the Form property executes JavaScript code when a submit event occurs. Using the onSubmit event handler for the Form object Enter Comments: