Código PHP:
print ("if ( theForm.Q" . $row["QUESTION_ID"] . ".value == \"\")\n{\nreturn ( true );\n}\n" );
print (" else \n{\nvar a = theForm.Q" . $row["QUESTION_ID"] . ".value;
var filter=/^[A-Za-z][A-Za-z0-9_]*@[A-Za-z0-9_]+.[A-Za-z0-9_.]+[A-za-z]$/;
if (a.length == \"\")\nreturn ( true );\n
if (filter.test(a))\nreturn ( true );\n
else\n{\nalert(\"Usted debe ingresar una dirección de correo válida\");
theForm.Q" . $row["QUESTION_ID"] . ".focus();\nreturn ( false );\n}\n" );
Código PHP:
print ("if ( theForm.Q" . $row["QUESTION_ID"] . ".value == \"\") {\n alert( \"Usted no ha completado el campo de texto requerido en la pregunta #" . $counter . ".\" );\ntheForm.Q" . $row["QUESTION_ID"] . ".focus();\nreturn ( false );\n}\n" );