squidz
April 18th, 2003, 05:50 PM
I have an email form that was finally implemented by use of a tutorial here. Though I may have mutilated the simple code.
I'm having troubler figuring out how to verify the input and getting the prompts to appear before jumping to the Thank You frame. I just want to kick the errors if the input is not correct and then submit and move to frame 10. Simple eh? Here's the walk through and code. Maybe someone who really knows action script can help me get this done.
Walk thru process:
In frame 1
input email address
select radio button choice
on release of button
- check valid email format
-- if no, display "Please input valid email address" in text box EmailStatus
-- if yes,
- check that a radio button is selected
-- if no, display "Please select WILL or WILL NOT attend" in text box EmailStatus
-- if yes,
- load variables and post to snowMailPHP.php (send email)
- if variables loaded, go to frame 10 and stop (Thank You message), form will no longer be visible.
Here is the current code for the submit button: somewhere at the end, I want to add a gotoAndStop(10). When I do, it will do it regardless of whether the input is correctly input. Though my radio button checking works, I don't know that it is actually proper....
on (release) {
if (!Email.length || Email.indexOf("@") == -1 || Email.indexOf(".") == -1) {
EmailStatus = "Please enter a valid E-mail address";
}
else if (!radio.length) {
EmailStatus = "Please select WILL or WILL NOT";
}
else {
loadVariablesNum ("snowMailPHP.php", "0", "Post");
}
}
Thanks.
I'm having troubler figuring out how to verify the input and getting the prompts to appear before jumping to the Thank You frame. I just want to kick the errors if the input is not correct and then submit and move to frame 10. Simple eh? Here's the walk through and code. Maybe someone who really knows action script can help me get this done.
Walk thru process:
In frame 1
input email address
select radio button choice
on release of button
- check valid email format
-- if no, display "Please input valid email address" in text box EmailStatus
-- if yes,
- check that a radio button is selected
-- if no, display "Please select WILL or WILL NOT attend" in text box EmailStatus
-- if yes,
- load variables and post to snowMailPHP.php (send email)
- if variables loaded, go to frame 10 and stop (Thank You message), form will no longer be visible.
Here is the current code for the submit button: somewhere at the end, I want to add a gotoAndStop(10). When I do, it will do it regardless of whether the input is correctly input. Though my radio button checking works, I don't know that it is actually proper....
on (release) {
if (!Email.length || Email.indexOf("@") == -1 || Email.indexOf(".") == -1) {
EmailStatus = "Please enter a valid E-mail address";
}
else if (!radio.length) {
EmailStatus = "Please select WILL or WILL NOT";
}
else {
loadVariablesNum ("snowMailPHP.php", "0", "Post");
}
}
Thanks.