I am new to this so someone PLEASE HELP ME!!

I have a php form which I am trying to check. My code is shown below (only the piece which is questionable). This code works, however, what I want is the line I currently have commented off. If I comment off the first "if" statement (the one I don't want) I get an error saying "Object Expected". What am I doing wrong? Why will it work for the first if statement but not the second?


<script language="JavaScript" type="text/javascript">
function checkform (form1)
{if (form1.txtJobNo.value == "C"){
//{if (preg_match("/[A-a]{2,2}[0-9]{8,8}/", form1.$jobno)){
alert ("Please enter a valid job number");
return False;}
}