<script type="text/javascript">
try{
var variable3=(document.forms[0]).server_Name.value;
var variable=(document.forms[0]).job_Name.value;
}catch(err){}
function returnall()
{
var vald2=checkempty();
var vald3=checkspace();
var vald1=checkemail(variable3);
if(vald2 && vald3 && vald1)
{
return true;
}
return false;
}
function checkemail(variable3)
{
bcd = document.getElementById('EmailAd');
var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
if (!filter.test(bcd.value)&& bcd.value != '')
{
document.getElementById('emailvalid').innerHTML = 'Please enter a valid email Address';
return false;
}
}
function checkempty()
{
var abc, bcd, cde, def, efg, fgh, ghi
abc = document.getElementById('jobn');
bcd = document.getElementById('EmailAd');
cde = document.getElementById('pass');
if (abc.value == ''&& bcd.value == ''&& cde.value == '')
{
document.getElementById('nodata').innerHTML = 'Please enter jobname,Email and Password ';
}
else
if(bcd.value == ''&& cde.value == '')
{
document.getElementById('nodata').innerHTML = 'Email and Password cannot be left blank';
}
else
if(abc.value == '' && cde.value == '')
{
document.getElementById('nodata').innerHTML = 'Job name and Password cannot be left blank';
}
else
if(abc.value == ''&& bcd.value == '')
{
document.getElementById('nodata').innerHTML = 'Job name and Email cannot be left blank';
}
else
if (abc.value == '')
{
document.getElementById('nodata').innerHTML = 'Job name cannot be left blank';
}
else
if (bcd.value == '')
{
document.getElementById('nodata').innerHTML = 'Email cannot be left blank';
}
else
if (cde.value == '')
{
document.getElementById('nodata').innerHTML = 'Password cannot be left blank';
}
return false;
}
function checkspace()
{
abc = document.getElementById('jobn');
var filter=(/\s/g);
if (!filter.test(abc.value))
{
return false;
}
else
{
document.getElementById('checkspace').innerHTML = 'Please do not enter spaces in job name field';
return true;
}
}
</script>
</head>
<body bgcolor="#555555">
<form name="myForm" action="/WorkProject/WebContent/index.jsp" method="post" onSubmit="return returnall();" >
Though the page runs fine when i compile the page i get a script error "void functions cannot return a value"in form tag..please help
<form name="myForm" action="/WorkProject/WebContent/index.jsp" method="post" onSubmit="return returnall();" >