Allora io ho questo codice per un form di registrazione (fatto malissimo ma sono alle prime armi)

Codice PHP:
<html
<
head

<
script language="javascript">
function 
validate()
{
var 
str=true;
document.getElementById("msg1").innerHTML="";
document.getElementById("msg4").innerHTML="";
document.getElementById("msg2").innerHTML="";
document.getElementById("msg3").innerHTML="";
document.getElementById("msg5").innerHTML="";
document.getElementById("msg6").innerHTML="";
document.getElementById("msg7").innerHTML="";
document.getElementById("msg8").innerHTML="";

if(
document.modulo.user.value=='')
{
document.getElementById("msg1").innerHTML="<img src=\"http://images.findicons.com/files/icons/1687/free_web_design/16/sign_warning.png\" align=\"absmiddle\">Inserire un username.";
str=false;
}

if(
document.modulo.pass.value=='')
{
document.getElementById("msg2").innerHTML="<img src=\"http://images.findicons.com/files/icons/1687/free_web_design/16/sign_warning.png\" align=\"absmiddle\">Inserire una password.";
str=false;
}

else if(
document.modulo.pass.value.length 3)
{

document.getElementById("msg5").innerHTML="<img src=\"http://images.findicons.com/files/icons/1687/free_web_design/16/sign_warning.png\" align=\"absmiddle\">Inserire almeno [b]3[/b] caratteri.";
str=false;
}

else if(
document.modulo.pass.value.length 15)
{
document.getElementById("msg6").innerHTML="<img src=\"http://images.findicons.com/files/icons/1687/free_web_design/16/sign_warning.png\" align=\"absmiddle\">Inserire al massimo [b]15[/b] caratteri.";
str=false;
}

if(
document.modulo.pass.value!=document.modulo.re_pass.value)
{
document.getElementById("msg3").innerHTML="<img src=\"http://images.findicons.com/files/icons/1687/free_web_design/16/sign_warning.png\" align=\"absmiddle\">Le password inserite non coincidono.";
str=false;
}

var 
validate_char= /^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z0-9]{2,4}$/;
if(!
document.modulo.email.value.match(validate_char))
{
document.getElementById("msg4").innerHTML="<img src=\"http://images.findicons.com/files/icons/1687/free_web_design/16/sign_warning.png\" align=\"absmiddle\">Inserire un indirizzo email valido.";
str=false;
}

if(
document.modulo.firstname.value=='')
{
document.getElementById("msg7").innerHTML="<img src=\"http://images.findicons.com/files/icons/1687/free_web_design/16/sign_warning.png\" align=\"absmiddle\">Inserire il nome.";
str=false;
}

if(
document.modulo.lastname.value=='')
{
document.getElementById("msg8").innerHTML="<img src=\"http://images.findicons.com/files/icons/1687/free_web_design/16/sign_warning.png\" align=\"absmiddle\">Inserire il cognome.";
str=false;
}
return 
str;

}
</script>

</head> 
<body> 


 
<!-- Procediamo costruendo il nostro form che passerà le informazioni inserite alla pagina data_insert.php.  
Da notare:  
1. action="data_insert.php?action=add&type=user" - che ci permette di passare le 2 variabili action e type,  
con i loro rispettivi valori, add e user  
2. il richiamo delle funzioni javascript al premere del pulsante "Conferma": onSubmit="return (ver() && ControllaMail());" -->  

<form name="modulo" action="data_insert.php?action=add&type=user" method="post" onSubmit="return validate()">
<table border="0">  
<table border="0">
    <tr>
      <td width="160"><div align="left">[b]Nome:[/b]
</div></td>
      <td width="100"><input id="firstname" size="20" type="text" name="firstname" class="username"></td>
    </tr> 

    <tr>
      <td width="160">

</td>
      <td width="100"><div><span id="statusx"></div><div id="msg7" style="color:#FF0000"></div></td>
    </tr>

<tr>
      <td width="160"><div align="left">[b]Cognome:[/b]
</div></td>
      <td width="100"><input id="lastname" size="20" type="text" name="lastname" class="username"></td>
    </tr> 

    <tr>
      <td width="160">

</td>
      <td width="100"><div><span id="statusx"></div><div id="msg8" style="color:#FF0000"></div></td>
    </tr>

    <tr>
      <td>
   
    <tr>
      <td width="160"><div align="left">[b]Username:[/b]</div></td>
      <td width="100"><input id="user" size="20" type="text" name="user" class="username"</td>
    </tr> 

    <tr>
      <td width="160"><font face="arial" size="2">Il nome utente deve avere 
 minimo [b]3[/b] e massimo [b]15[/b] 
 caratteri alfanumerici.</font></td>
      <td width="100"><table border="0"><tr><td><div><span id="status"></div><div id="msg1" style="color:#FF0000"></td></tr><tr><td>
</td></tr></table></td>
    </tr>

    <tr>
      <td width="160"><div align="left">[b]Email:[/b]
</div></td>
      <td width="100"><input id="email" size="20" type="text" name="email" class="email"></td>
    </tr> 

    <tr>
      <td width="160">
</td>
      <td width="100"><div><span id="statusx"></div><div id="msg4" style="color:#FF0000"></div></td>
    </tr>

    <tr>
      <td width="160">
</td>
      <td width="100">
</td>
    </tr>

    <tr>
      <td width="160"><div align="left">[b]Password:[/b]</div></td>
      <td width="100"><input size="20" type="password" name="pass" class="password"></td>
    </tr> 

    <tr>
      <td width="160" align="left"><font face="arial" size="2">La password deve avere 
 minimo [b]3[/b] e massimo [b]15[/b] 
 caratteri, può contenere 
 numeri e lettere sia 
 maiuscole che minuscole.</font></td>
      <td width="100"><table border="0"><tr><td><div id="msg2" style="color:#FF0000" class="error"></div><div id="msg5" style="color:#FF0000"></div><div id="msg6" style="color:#FF0000" class="error"></div></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td>

</td></tr></table>
    </tr>

    <tr>
      <td width="160"><div align="left">[b]Conferma Password:[/b]</div></td>
      <td width="100"><input size="20" type="password" name="re_pass" class="conferma"></td>
    </tr> 

    <tr>
      <td width="160">
</td>
      <td width="100"><div id="msg3" style="color:#FF0000"></td>
    </tr>

    <tr>
      <td width="160">
</td>
      <td width="100">
</td>
    </tr>

    <tr>
      <td width="160">
</td>
      <td width="100">
</td>
    </tr>

    <tr>
      <td width="160">
</td>
      <td width="100"><center><button type="submit" class="registrazione">Registrati</button></center></td>
    </tr>

  </table>
</td>
</tr>
</table>
</form>

</p> 
</body> 
</html> 
come puoi notare ho aggiunto alcune limitazioni al form per evitare agli utenti di iscriversi piu volte e vorrei fare in modo che nei campi nome e cognome l'utente possa inserire solo lettere, se aggiunge anche numeri che appaia con l'inner html sotto al campo con scritto "caratteri numerici non ammessi". come posso fare?

grazie.