
November 21st, 2003, 04:57 PM
|
|
|
|
Join Date: Apr 2007
Posts: 1
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
PLEASE HELP ME!!
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? I am new to this and I am trying to teach myself and there is just only so much a book can do for you. I really appreciate any help I can get.
<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;}
}
<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;}
}
|