I have the following form:
<form action="myaction" method="post" enctype="multipart/form-data">
<span class="required">*</span>Email</td>
<input type="text" name="email" id="moosendid" />
<input type="submit" id="submit1" value="submit" class="button" />
</form>
and a javascript function:
function MoosendMail(moomail) {...}
I need on submit to run the function before the action of the form. I tried something like this:
$(document).ready(function() {
$('input#submit1').on('click',function() {
MoosendMail($('input#moosendid').val());
});
});
with no success.
Any ideas?