questa la funzione di convalida:
codice:
// Script prepared by Answer Studios / ToUnite.com
// Version 1.1 (Feb. 1, 2001
// Logic:
// 8 steps: Preset elements, 6 error checks, write error (if appicable)
// --- Presets
function convalida() {
count = 0;
Err = 0;
// #1 Check for invalid characters
// Create an arroay of invalid characters
invChars = new Array(" ", "#", "$", "%", "!", "^", "~", "'", "*", "(", ")", ",", "<", ">", "/", "\\");
// Loop through Array and see if there are any matches, if yes then throw and error.
for (i=0; i<invChars.length; i++) {
if (email.indexOf(invChars[i])>=0) {
Err = 1;
}
}
// #2 If passed previous error step >>> Check the @ symbol (1 instance of the symbol)
if (Err == 0) {
// Loop by character through the email string for the @ symbol, count the number of instances
for (i=0; i<email.length; i++) {
if (email.charAt(i) == "@") {
count = count+1;
}
}
// If there is not 1 instance (0 or more than 1) then throw an error.
if (count != 1) {
Err = 2;
}
}
// Split the email string by the @ sign, forming the name portion and the domain portion.
if (Err == 0) {
splitEmail = email.split("@");
emailName = splitEmail[0];
emailDom = splitEmail[1];
// #3 Verify minimum characters in name portion (minimum of 1), if not throw an error.
if (emailName.length<1) {
Err = 3;
}
// #4 Verify there is a . (dot) in the domain portion
if (emailDom.indexOf(".")<0) {
Err = 4;
} else {
// #5 Verify a minimum of 2 characters before the dot, if not throw an error.
// First split the domain portion by the . (dot)
splitDom = emailDom.split(".");
if (splitDom[0].length<2) {
Err = 5;
}
// #6 Verify a minimum of 2 characters after the dot, if not throw an error.
if (splitDom[1].length<2) {
Err = 6;
}
}
}
// Associate the Err number into the message array for displaying results on the screen.
ErrMess = ["L'e-mail è stata inviata", "Carattere non valido!", "Hai dimenticato la 'chiocciolina'!", "Il tuo nome deve essere di almeno di un carattere!", "Manca il puntino!", "Il dominio del tuo ISP deve essere almeno di due caratteri!", "Il suffisso deve essere almeno di due caratteri (es.:it,com)!"];
valid = ErrMess[Err];
if (valid == "L'e-mail è stata inviata") {
loadVariablesNum("pagina.asp", 0, "POST");
}
trace(valid);
}
crea un campo di testo di tipo input e gli associ il nome della variabile email
al pulsante:
on (release) {
convalida();
}
poi ci sarebbe la guida:
http://flash-mx.html.it/guide/view_l...dguida=6&id=85
se vuoi l'esempio che ti ho preparato.. metti la e-mail
tiger