Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Send a form from swf 1

Status
Not open for further replies.

247138

Programmer
Jul 3, 2005
32
RO
I need to send my contact form wich consists on 6 separate boxes with input text. I also have the 2 buttons: reset & submit I used the script provided by CMD 83 for purexenon [on key frame 1:
(depending on mailform you're using)
(on a keyframe)
USER = "your@email.com";
SUBJECT = "subject of the mail";
LINK = "stop();

here you also make the form with var: varname
(so this appears in your mailbox)

on the submit button:

go to and play frame 2
here on a keyframe:
getURL(" "_blank", "POST");
stop();

put a thank you or sending... on this frame if you like

the person will get a pop-up with whatever you put on
(this is the mailform from my provider, adjust if you have your own)] {here it's the entire messege, but i used it like he said}
but it doesn't work. on clicking "submit" another page opens [in my browser] with this adress:


and the messege:

tlx_EmailTo Must Be A Valid Email Address

What did I do wrong?
PLS HEEEELP !!!!!
I'm a donkey on the edge!!!!!!

:))))
 
ok first,
did you make sure that your instance names for your textboxes (name_txt, email_txt, ...) went here:

pic.gif
 
i made a form for what it should look like here. This contact form will go to your email (the one on your site). Test it and see if you get an email.

if you can open the fla, then download it here and make sure everything is the same
 
It wasnt ok. the place, ok. the names not. Now i have another problem: submit button is a button in fla, but not in swf. can't explain. In fla, even when i "enable simple button", the submit button is A BUTTON. In swf it doesn't even have an area. ?????
 
yeah. romanian.
no metter though.
i don't think u really need to understand. Anyways
1. Your form is ok.
2. ofcourse i can't open it X-(
3 Do you mind if you do that again, [one the i should be able to modify the grafics for...] in flash mx 2004. i have that version too, only not a try. so i should be able to open it. PLS. I would apreciate it. THX
 
_root.nextFrame();
OR
&& _root.company_txt.text != ''
&& _root.email_txt.text != ''
&& _root.address_txt.text != ''
&& _root.
etc. My form is amc called Form, and it's within a mc called Symbol 53 wich is in main. So _root sould be _root, or this, or _parent, or...
thx
 
oh ok
make sure the code is within the "form" mc, and replace the "_root." with "this.
 
I don't mean to be rood but is this:
if (_root.name_txt.text != ''
&& _root.company_txt.text != ''
&& _root.email_txt.text != ''
&& _root.address_txt.text != ''
&& _root.tel/fax_txt.text != ''
&& _root.message_txt.text != '')
[for enableing submit_btn]
correct?
The code is within the "form" mc, and I replaced the "_root." with "this."
so it looks like this:
if (this.name_txt.text != ''
&& this.company_txt.text != ''
&& this.email_txt.text != ''
&& this.address_txt.text != ''
&& this.tel/fax_txt.text != ''
&& this.message_txt.text != '')
 
becouse it doesn't eneble my submit_btn
 
ok then remove the this.

it should look like:

if (name_txt.text != ''
&& company_txt.text != ''
&& email_txt.text != ''
&& address_txt.text != ''
&& tel/fax_txt.text != ''
&& message_txt.text != '')

//enables the submit button
submit_btn.enabled = true;
} else {
...
 
change this also

reset_btn.onRelease = function() {

//sets each button blank
name_txt.text = "";
company_txt.text = "";
email_txt.text = "";
address_txt.text = "";
telfax_txt.text = "";
message_txt.text = "";
};
 
this part is now ok.
i still don't recieve any message though, when i press submit button.
 
ok, did you put the php file with the swf file on your website (you wont get an email if you test on your computer)
 
ok i'm not an expert but in the code you gave me:

stop();
//actions for reset button
reset_btn.onRelease = function() {

//sets each button blank
name_txt.text = "";
company_txt.text = "";
email_txt.text = "";
address_txt.text = "";
telfax_txt.text = "";
message_txt.text = "";
};

//actions for submit button
submit_btn.onRelease = function() {

//import variables from each input box
sender_mail = _root.email_txt.text;
sender_name = _root.name_txt.text;
company = "<br> Company: "+_root.company_txt.text;
address = "<br> Address: "+_root.address_txt.text;
telfax = "<br> Tel/Fax=: "+_root.telfax_txt.text;
message1 = "<br> Message=: "+_root.message_txt.text;

//format for the subject
sender_subject = "Contact: "+sender_name;

//format for the message
sender_message = "User submitted message: <br> Name: "+sender_name+"<br> Email: "+ sender_mail + company + address + telfax + message1;

//load variables to the php file
loadVariables("sendmail.php", this, "POST");

//check to see if everything went A-OK
this.onData = function() {
_root.nextFrame();
if (this.output == 'error') {
_root.gotoAndStop("error");
} else {
_root.gotoAndStop("success");
}
};
};


//this is to make sure all the fields have been entered
k = new Object();

//onKeyUp calls this function each time a key is pressed
k.onKeyUp = function() {

//checks if any fields are blank
if (_root.name_txt.text != ''
&& _root.company_txt.text != ''
&& _root.email_txt.text != ''
&& _root.address_txt.text != ''
&& _root.tel/fax_txt.text != ''
&& _root.message_txt.text != '') {

//enables the submit button
_root.submit_btn.enabled = true;
} else {

//disables the submit button
_root.submit_btn.enabled = false;
}
};

//this listener keeps checking the status of the onKeyUp
Key.addListener(k);

//the button must start out disabled
_root.submit_btn.enabled = false;



shouldn't there be a link, to a server PHP that will recieve and process the form?
:-B
 
ok
sorry.
(you wont get an email if you test on your computer)
THAT"S KINDA NEW 4 me.
i'll see how i test it
i presume that if i upload ot to the server will be ok.

:-B
 
and yes, the php u gave me is on the server
 
ok it might not work because you have to change this:
Code:
    //import variables from each input box
    sender_mail = email_txt.text;
    sender_name = name_txt.text;
    company = "<br> Company: "+company_txt.text;
    address = "<br> Address: "+address_txt.text;
    telfax = "<br> Tel/Fax=: "+telfax_txt.text;
    message1 = "<br> Message=: "+message_txt.text;
 
right now the code looks like this:

stop();
//actions for reset button
reset_btn.onRelease = function() {
//sets each button blank
nume_txt.text = "";
companie_txt.text = "";
email_txt.text = "";
adresa_txt.text = "";
telefon_txt.text = "";
mesaj_txt.text = "";
};
//actions for submit button
submit_btn.onRelease = function() {
//import variables from each input box
sender_mail = email_txt.text;
sender_name = nume_txt.text;
user_email = "ovidiu@yahoo.com";
//change to your real email
company = "<br> Company: "+companie_txt.text;
address = "<br> Address: "+adresa_txt.text;
telfax = "<br> Tel/Fax=: "+telefon_txt.text;
message1 = "<br> Message=: "+mesaj_txt.text;
//format for the subject
sender_subject = "Contact: "+sender_name;
//format for the message
sender_message = "User submitted message: <br> Name: "+sender_name+"<br> Email: "+sender_mail+company+address+telfax+message1;
//load variables to the php file
loadVariables("sendmail.php", this, "POST");
//check to see if everything went A-OK
onData = function () {
nextFrame();
if (output == 'error') {
gotoAndStop("error");
} else {
gotoAndStop("success");
}
};
};
//this is to make sure all the fields have been entered
k = new Object();
//onKeyUp calls this function each time a key is pressed
k.onKeyUp = function() {
//checks if any fields are blank
if (nume_txt.text != '' && companie_txt.text != '' && email_txt.text != '' && adresa_txt.text != '' && telefon_txt.text != '' && mesaj_txt.text != '') {
//enables the submit button
submit_btn.enabled = true;
} else {
//disables the submit button
this.submit_btn.enabled = false;
}
};
//this listener keeps checking the status of the onKeyUp
Key.addListener(k);
//the button must start out disabled
this.submit_btn.enabled = false;


I uploaded it on the server. I don't get a notification in my e-mail though. I've looked through it a thousand times. I don't get it. Is there an error somewhere?
LEGEND:
nume name
companie company
adresa address
telefon telfax
mesaj message
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top