I have an HTML form defined as
<form name="writeYourAd" id="writeYourAd" method="post" action="post.php?action=preview" onsubmit="return checkContentForm(this);" enctype="multipart/form-data">
If I use a , it works fine. But if instead I use this:
<a href="#" class="mmh_orngebtn mmh_grybtn" onclick="javascript:document.writeYourAd.submit();"><span>continue</span></a>
It submits the form but does not run the checkContentForm function (or at least it lets me through anyways).
Why? What can I do?
I think that you need to point the onclick handler to your checkContentForm function.
Or write your own submit function that includes calling checkContentForm and then submits.