View Single Post
  #1 (permalink)  
Old Jul 23rd, 2007, 11:38
kyutkb kyutkb is offline
New Member
Join Date: Jul 2007
Location: dubai
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
FLASH - validating input fields if empty before clicking submit button

hi there..

i have a question about flash.. i'm using flash CS3 and i don't know if it really matters. here goes my question:

whenever i run to test this on first instance(see below action script), the first statement is bypassed. it would still go to the "thank you.." frame, when all i wanted to do was to prevent the submit button to send a blank field (e.g company, contact, email & product) which is mandatory in my form to be filled-up. below is my code.

// When the button is clicked and if any of the fields listed are empty display the message.
on (release) {
if (company eq "" || contact eq "" || email eq "" || product eq "") {
message = "Please fill in all mandatory fields";
//otherwise process the form and go to frame 11 "thank you for your inquiry"
} else {
loadVariablesNum("process.php", 0, "POST");
gotoAndStop(11);

if someone out there could help, it is much appreciated.. thanks!
Reply With Quote