visitor13
August 26th, 2004, 01:21 AM
I'm using mailform.pl script from Matt's Archives. I've built a simple "verifyemail();" function in Flash that prevents the mailform from being loaded if certain conditions are not met. But when they are, the form loads, mail is being sent and my function's name along with its variables is being passed over along with the comments.
This is the function:
verifyEmail = function (emailString) {
// this will turn the data entered by the user into the email input text field to the string
emailString = email;
// this will locate and assign var names to two characters always present in every email address: "@" and "."
char1 = emailString.indexOf ("@");
char2 = emailString.lastIndexOf (".");
// this will isolate a part of address from (and including) "." to the end of the string (ie. ".com")
extension = emailString.substr (spot2);
// this will return the the length of the extension as a number (ie. 4 in case of ".com")
extLength = extension.length;
// trace(spot1);
// trace(spot2);
// trace(extension);
// trace(extLength);
};
What happens is that the email passes this info when "send" button is clicked:
verifyEmail: [type Function]
comments: test
char1: 7
char2: 24
xtnsion: submittedemail@webserver.com
extLength: 28
And this is the code attached to the send button:
send_mc.sendHit_mc.onRelease = function () {
recipient = "name@site.com";
verifyEmail ();
//email is being turned into a string and two characters: "@" and ".", present in every e-mail address are being searched for
//trace command returns idexex of those characters (if they are not entered into the field by the user "-1" is being returned
//if all the fields contain characters the action is being executed
if (realname.length > 2 && email.length > 0 && comments.length > 0 && char1 !== -1 && char2 !== -1 && extLength > 2) {
//these three lines are being executed if one or more input text fields are empty
subject = "Site Name Feedback";
loadVariables ("/cgi-bin/contact.pl", this, "POST");
//the following lines make all the graphic elements invisible except for the thank you note, informing user that his message has been sent
inputTextBG_mc._visible = false;
inputTextDescr_mc._visible = false;
intro_txt._visible = false;
direct_txt._visible = false;
goBack_txt._visible = false;
send_mc._visible = false;
clear_mc._visible = false;
thankYou_txt._visible = true;
clear_btn._visible = false;
send_btn._visible = false;
//realname & email, in addition to being names of the variables are also the names of the corresponding text fields (enter all that data in the info panel). This ensures their easy visibility control.
realname_txt._visible = false;
email_txt._visible = false;
comments_txt._visible = false;
} else {
//if at least one of the conditions listed above is false, user is being asked to correct the provided information
intro_txt._visible = false;
direct_txt._visible = true;
goBack_txt._visible = true;
thankYou_txt._visible = false;
}
}
So how do I get rid of that info?
This is the function:
verifyEmail = function (emailString) {
// this will turn the data entered by the user into the email input text field to the string
emailString = email;
// this will locate and assign var names to two characters always present in every email address: "@" and "."
char1 = emailString.indexOf ("@");
char2 = emailString.lastIndexOf (".");
// this will isolate a part of address from (and including) "." to the end of the string (ie. ".com")
extension = emailString.substr (spot2);
// this will return the the length of the extension as a number (ie. 4 in case of ".com")
extLength = extension.length;
// trace(spot1);
// trace(spot2);
// trace(extension);
// trace(extLength);
};
What happens is that the email passes this info when "send" button is clicked:
verifyEmail: [type Function]
comments: test
char1: 7
char2: 24
xtnsion: submittedemail@webserver.com
extLength: 28
And this is the code attached to the send button:
send_mc.sendHit_mc.onRelease = function () {
recipient = "name@site.com";
verifyEmail ();
//email is being turned into a string and two characters: "@" and ".", present in every e-mail address are being searched for
//trace command returns idexex of those characters (if they are not entered into the field by the user "-1" is being returned
//if all the fields contain characters the action is being executed
if (realname.length > 2 && email.length > 0 && comments.length > 0 && char1 !== -1 && char2 !== -1 && extLength > 2) {
//these three lines are being executed if one or more input text fields are empty
subject = "Site Name Feedback";
loadVariables ("/cgi-bin/contact.pl", this, "POST");
//the following lines make all the graphic elements invisible except for the thank you note, informing user that his message has been sent
inputTextBG_mc._visible = false;
inputTextDescr_mc._visible = false;
intro_txt._visible = false;
direct_txt._visible = false;
goBack_txt._visible = false;
send_mc._visible = false;
clear_mc._visible = false;
thankYou_txt._visible = true;
clear_btn._visible = false;
send_btn._visible = false;
//realname & email, in addition to being names of the variables are also the names of the corresponding text fields (enter all that data in the info panel). This ensures their easy visibility control.
realname_txt._visible = false;
email_txt._visible = false;
comments_txt._visible = false;
} else {
//if at least one of the conditions listed above is false, user is being asked to correct the provided information
intro_txt._visible = false;
direct_txt._visible = true;
goBack_txt._visible = true;
thankYou_txt._visible = false;
}
}
So how do I get rid of that info?