Copia e incolla
codice:<%@ Language=VBScript %> <HTML> <HEAD> <script language="vbscript"> function ConfrontaMail(e_mail,conf_Email) if CStr(e_mail.value)<>CStr(conf_Email.value) then MsgBox "Le mail sono diverse",vbCritical,"Errore" else MsgBox "e_mail" if ControllaEmail (e_mail) then frmMail.submit() end if end if end function function ControllaEmail(oggetto) ControllaEmail=true strMail=oggetto.value if strMail<>"" then if len(strMail)>6 then CheckMail = True pos = Instr(1,strMail, "@") if pos >= len(strMail)-3 then CheckMail = False end if if pos < 2 then CheckMail = False end if dotpos = Instr(pos+1 ,strMail, ".") if dotpos > len(strMail)-2 then CheckMail = False end if if len( Mid(strMail, pos+1) ) < 5 or dotpos = 0 then CheckMail = False end if else CheckMail = False end if if not CheckMail then MsgBox "L'indirizzo e-mail " & vbCrLf & "'" & strMail & "'" & vbCrLf & "è errato." & vbCrLf & str ,vbCritical,"Errore inserimento email" oggetto.value="" oggetto.focus() ControllaEmail=false end if end if end function </script> </HEAD> <BODY> <form action="prein.asp" method="post" name="frmMail"> <table border="1" valign="top" align="center" class="login" width="50"> <tr> <td align="center">inserisci username:</TD> </tr> <tr> <td align="center"> <INPUT type="text" name="nome" class="formcol"> </td> <tr> <tr> <td align="center">inserisci e-mail: </TD> </tr> <tr> <td align="center"> <INPUT type="text" name="email" class="formcol"> </td> </tr> <tr> <td align="center">conferma e-mail: </TD> </tr> <tr> <td align="center"> <INPUT type="text" name="ConfEmail" class="formcol"> </td> </TR> <tr> <td align="center"height="30"> <INPUT type="button" value="vai" class="formcol" id="submit" name="submit" onclick="ConfrontaMail email,ConfEmail"> </TD> </tr> </table> </form> </BODY> </HTML>![]()


Rispondi quotando