Validating required fiels in a web form

Validating required fiels in a web form

I'm trying to validate required fields in a webform and I'm running into trouble with the javascript tools I'm using.  The ZohoCRM variables for First Name and Last Name don't work well with javascript because variables with spaces aren't valid.  Has anyone figured out how to force users to complete these forms using a field validation tool that accepts spaces?  Or, is does anyone know of a work-around for javascript?  I tried the obvious solution and removed the spaces from the variables.  When I remove the spaces ZohoCRM doesn't recognize the data and those fields don't get imported:  Here's the script I'm using, it works great for variables w/o spaces:

<!-- Form script-->
  <script language="JavaScript">
<!--
function validate(frm) {
//
// Check the Required fields to see if any characters were entered
//
if (frm.First Name.value.length == 0)
{
alert("Required Field: Please enter your First Name.")
frm.First Name.focus()
return false
}
if (frm.Last Name.value.length == 0)
{
alert("Required Field: Please enter your Last Name.")
frm.Last Name.focus()
return false
}
if (frm.Email.value.length == 0)
{
alert("Required Field: Please enter an e-mail address.")
frm.Email.focus()
return false
}
if (frm.Phone.value.length == 0)
{
alert("Required Field: Please enter a Phone number.")
frm.Phone.focus()
return false
}
if (frm.Company.value.length == 0)
{
alert("Required Field: Please enter your Company Name.")
frm.Company.focus()
return false
}
}
//-->
  </script><!-- End Form script-->