Ragazzi scusatemi... non sono un esperto...
Ho provato ad inserire il codice ma non funziona.
Guidatemi passo passo, se potete.
Questo è il form che devo controllare:
codice:
<form name=formmail action="mailer.php?action=send" method="post" onsubmit="return controllacampi()">
<INPUT name=-----OGGETTO type=hidden value="MESSAGGIO DAL SITO-----">
<table width="452" border="0" align="center" cellpadding="5" cellspacing="0" bgcolor="#FFCC99" class="stile2">
<tr bgcolor="#666666">
<td height="50" colspan="6"> <div align="center"> <span class="piccolo">Per
inviare un messaggio, o per richiedere informazioni,
compilare il form sottostante.</span></div></td>
</tr>
<tr>
<td colspan="6"><div align="center" class="piccolo"><font color="#000000">Tutti
i campi sono obbligatori</font></div></td>
</tr>
<tr>
<td width="11"></td>
<td width="81"> Nome</td>
<td colspan="4"> <input type="text" name="nome" size="40"> </td>
</tr>
<tr>
<td width="11"></td>
<td width="81"> Cognome</td>
<td colspan="4"> <input type="text" name="cognome" size="40">
</td>
</tr>
<tr>
<td width="11" rowspan="2"></td>
<td width="81"> E-mail</td>
<td colspan="4"> <input type="text" name="email" size="40">
</td>
</tr>
<tr>
<td>Telefono</td>
<td colspan="4"><input name="telefono" type="text" id="telefono" size="40"></td>
</tr>
<tr>
<td width="11"></td>
<td width="81"> Messaggio</td>
<td colspan="4"> <textarea name="messaggio" cols="40" rows="5" class="scroll"></textarea>
</td>
</tr>
<tr>
<td width="11"></td>
<td width="81"></td>
<td colspan="4"></td>
</tr>
<tr>
<td width="11" height="36"> </td>
<td height="36" width="81"></td>
<td width="49" height="36"> </td>
<td width="73" height="36"> <input type="submit" name="invio" value=" Invia ">
</td>
<td width="85" height="36"> <div align="center">
<input type="reset" name="cancella" value="Cancella">
</div></td>
<td width="153" height="36"></td>
</tr>
</table>
</form>
Presumo che nel codice che usavo precedentemente si debba cancellare la parte che controllva il campo "telefono", ma non so come collegare questo campo al nuovo codice che mi avete fornito.
Come faccio a collegare il campo "telefono" al codice che controlla l'inserimento di soli numeri? Eventualmente l'utente non avesse compilato correttamente il campo, dovrebbe apparire la solita finestra di avviso: alert("Form incompleto! Scrivi il numero di telefono").
Grazie ancora...