Can I submit a html <form> with <div> instead of <input type="submit"> ?
Like this:
<form method="post" action="" id="myForm">
<textarea name="reply">text</textarea>
</form>
<div>Submit the form by clicking this</div>
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The method you can use to submit a specific form is the following:
So in your example, you can add a click event handler on any element you like and trigger the form’s submit method through that:
And if you want to do it jQuery style (which I do not recommend for such a simple task);
In its full form:
References:
JavaScript API)jQuerysubmit() API