my javascript is not validating
<script type="text/javascript">
function checkname()
{
var str1=document.form.name.value
if (str1.length==0)
{
return true
}
else{
alert('Please Enter Your Name!')
return false
}
}
function checkrollno()
{
var ph=document.form.rollno.value
var l=ph.length
if((ph==""||ph==null))
{
alert('Enter the University Roll Number')
return false
}
if(l<10)
{
alert('Roll no. Consists Of 10 Digits ')
return false
}
return true
}
function checkPercent()
{
var name1=document.form.btech.value
var name2=document.form.12.value
if(name1==null||name1==""||name2==null||name2=="")
{
alert('Enter The Percentage')
return false
}
return true
}
</script>
and the form looks like
<form name="form" method="post" action="action.php" onSubmit="return (checkname(this) && checkrollno(this) && checkPercent(this))">