I am working on a php file for school and we have to do some javascript verification of first name, last name and email. If everything is OK we can choose if we want to add the driver or cancel. if something is wrong you go back to the form. I did the verify script in a small page and got it to work there, but when I put it in my php file it will not work anymore. Here are some snippets of the code:
<script type = "text/javascript" >
function val_name()
{
var namePattern = /^[A-Za-z]{3,25}$/;
if( !namePattern.test(document.upload.fn.value))
alert("Enter valid first name");
if( !namePattern.test(document.upload.ln.value))
alert("Enter valid last name");
var x=document.forms["upload"]["email"].value;
var atpos=x.indexOf("@");
var dotpos=x.lastIndexOf(".");
Bookmarks