Checking if the user has submitted a form

I have a form on one page (it’s form.php) and the action=“form.php” method=“post” on the form. At the end of the form I have <input type=“submit” name=“submit” value=“submit”>. And then I have a big if/else tree that checks isset($_POST[‘submit’]) and if it is set then it goes on to checking if all the required fields have been filled out and if it isn’t it just displays the form. Simple enough so far.
But what if I want to get rid of the submit button and use a link instead (<a href=“javascript:document.forms[0].submit()”>)? How would I then go about checking if the user came to that page via submitting the form or just coming there normally.
Thanks.

EDIT: Wow, just my luck, I seem to have submitted this under the client side section instead of the server side. Can a mod please move it? thanks