Thus, only with javascript.
The correct method is to use a button of the type <input type="submit">
, one <button type="submit">
or a <input type="image">
, the latter two have a similar effect to button
allows other nested elements (including images), and the second allows sending by clicking on a specific image (sending together the coordinates clicked).
If you still want one <a>
, follows the code. I do not recommend it because it affects the accessibility of the form.
<form method="post" action="" id="mail_form">
<div id="newsletter">
<input type="text" name="email_newsletter" />
<div class="newslink">
<input type="hidden" name="submit_newsletter" />
<a href="#" onClick="document.getElementById('mail_form').submit();">ENVIAR</a>
</div>
</div>
</form>
Remember that nowadays, using CSS, you can leave the submit
with the appearance of a common link, with the advantage of not "breaking" the normal functionality of form
.
I’d still have a gambit that’s using a <label for="botaodeenvio">
and hide the original button with position, opacity, etc, but will remain not a <a>
. Better use CSS and conventional methods.
For this you will have to do in javascript or jquery.. It’s okay for you if I give the answer in javascript?
– Silvio Andorinha
@pc_oc I believe that the code that Bacco put is the best solution to your question..
– Silvio Andorinha