so this might be something super simple to do, but I can't seem to get it. I have a form and a validation for it. The validation text works. If I use a normal submit button the form works correctly, but if I use javascript to submit the form, it does not work 100%.
<form id="transport" name="transport" method="post" action="submit_trans_request.php">
<input type="text" name="f_name" value="<?php echo htmlspecialchars($row['f_name'], ENT_QUOTES); ?>" style="font-size:16px;" />
<a href="javascript:onclick=validateForm(); document.transport.submit();" class="submit_btn">Submit</a>
So basically I am looking for a way to stop the submit if validateForm() returns an alert. Not sure how I go about that.
Any help is greatly appreciated. Thank you in advance!
return false;