Skip to main content
October 17, 2007
Question

contact form send without all fields entered

  • October 17, 2007
  • 2 replies
  • 217 views
I have a contact form set up with 5 fields and it can only be sent if all 5 fields are filled in. Not all my clients want to enter a phone number or wedding date, so I need to know how to change the action script so that it will still send if only 2 or 3 of the text fields have been entered. I think the following is the action script I need to edit -- I just don't know how;

_submit.onRelease = function(){
if (txt1.text == txt1.startText ||
txt2.text == txt2.startText ||
txt3.text == txt3.startText ||
txt4.text == txt4.startText ||
txt5.text == txt5.startText) {
clearFields();
gotoAndStop(3);
} else {
_this.loadVariables("email.php", "POST");
clearFields();
gotoAndStop(2);
}
}


Thank you for any help you can send.
Susan
This topic has been closed for replies.

2 replies

December 5, 2007
Don't worry, there is something wrong with the second field and I will just have to figure it out.

Thanks anyway,
Susan
Inspiring
October 17, 2007
Right - this is what you need to change. Take out any text fields that
you're ok with leaving blank as this is testing to see if any of them are
the same as they started with. For example, say you only require txt1 and
txt3 be complete:

_submit.onRelease = function(){
if (txt1.text == txt1.startText ||
txt3.text == txt3.startText){
clearFields();
gotoAndStop(3);
} else {
_this.loadVariables("email.php", "POST");
clearFields();
gotoAndStop(2);
}
}


--
Dave -
Head Developer
http://www.blurredistinction.com
Adobe Community Expert
http://www.adobe.com/communities/experts/


October 17, 2007
Wow, that was amazing. One of the first times that I have asked a question, (while learning to edit my flash web site template) and received a straight forward answer that made sense and really worked!

Thank you so much,
Susan