
Ian Holden - 2008-05-23 17:59:18
I have an form field that I have added with the following code fragment:
$errMsg = $form->AddInput( array(
"TYPE" => "text",
"NAME" => "ReviewDate",
"ID" => "ReviewDate",
"SIZE" => 10,
"VALUE" => "",
"ValidateAsNotEmpty" => 1,
"ValidateRegularExpression" => '^\d\d\d\d-\d\d?-\d\d?$',
"ValidateRegularExpressionErrorMessage" => "Review Date not entered as YYYY-MM-DD",
"ValidationErrorMessage" => "Not a valid Review Date value",
"LABEL" => "Review Da<u>t</u>e",
"ACCESSKEY" => "T"
));
Now, when the value in the field is "2008-11-12" the validation for this field fails. Dumb question 1 is "Can someone see a mistake in the regular expression?".
Question 2 is "Is there a method call or some set of code that I can use to determine how a field value is failing its validation check?". How could I determine why a value isn't passing a check? Or to capture some debug details?