Ho un problema nella verifica dei dati inseriti in un form e.mail nel quale oltre ai campi normali ho tre checkbox ("soluzioni").
Se un campo non viene compilato compare regolarmente la scritta di tornare indietro a compilarlo.
Questo però non si verifica se non viene messa la spunta in alcuna casella checkbox e l'e.mail parte lo stesso.
Vorrei che, sia se un campo non viene compilato sia se non viene messa la spunta un un checkbox, il messaggio non partisse e facesse tornare indietro l'utente a compilare regolarmente il form.
Di seguito riporto il codice che ho usato.
<%
Set Mail = Server.CreateObject("Persits.MailSender")
....ecc.ecc.
Body = Body & "COGNOME: " & Request("Cognome") & chr(13) & chr(10)
Body = Body & "NOME: " & Request("Nome") & chr(13) & chr(10)
Body = Body & "INDIRIZZO: " & Request("Indirizzo") & chr(13) & chr(10)
Body = Body & "COMUNE: " & Request("Comune") & chr(13) & chr(10)
Body = Body & "E.MAIL: " & Request("Email") & chr(13) & chr(10)
Body = Body & "TELEFONO: " & Request("Telefono") & chr(13) & chr(10)
Body = Body & "SOLUZIONI: " & Request("Soluzione") & chr(13) & chr(10)
Mail.Send
%>
<%
For Each item in Request.Form()
If Request.Form(Item) = "" Then Errore = Errore & ("Il dato ") & Item & " non è stato inserito. Si prega tornare indietro e compilare tutti i campi. Grazie.
"
Next
If Errore <> "" Then
Response.write Errore
Response.End
End if
%>
Qualcuno può gentilmente dirmi dove sbaglio?
Grazie

Rispondi quotando