what you are trying to do is not really clear to me. Are you trying to combine server-side way of working with client-side script?
Coz I see that you are trying to send ord[] to a PHP file which contains a Javascript code.
To provide client-side checking, put the code in that page itself. You can put it in another file as it would cause your browser to request a new page which has nothing to do with the first one.
I suggest server-side checking, for instance:
<form action="validate.php" method="post">
<input type="text" name="ord">
</form>
in validate.php
$ord=$_POST['ord'];
if (empty($ord)){
//error message here
}