Yes, that would only work with javascript enabled. If you want to cover both eventualities, you could put a normal submit button inside a pair of <noscript> tags - then you'd have to figure out how to hide the other button when there is no javascript enabled.

no - i am just concerned with getting the form submitted. post fileUpload checks if the form was submitted. I tried running the code above, but it didn't seem to do anything. with the submit button, you would set the name to fileUpload to run the php validation. I am not sure here how to do this though with a link. I understand the code, and it should work. I must me doing something wrong.

Now you've confused me. The PHP would have to be conditional on some element that is present in the $_POST array. The form name is not. So, if(isset($_POST['form_field_name']) && $_POST['form_field_name'] == 'some_value') { ?>

The javascript would submit based on the form's name attribute value, i.e., document.forms['fileUpload'].submit();