PDA

View Full Version : form, form, form, form!!!


korai9989
05-11-2004, 09:57 PM
I am having a most stressful conflict with forms. I made a form in flash mx and i named all the variables correctly, then i made a submit button, i put this as the actionscript:

on(release){
recipient = "myemail@mysite.com";
subject = "Form Submission";
getURL(".../formmail.pl","_blank","GET");
getURL("index.htm","_self");
}

It doesn't work! I put the formmail.pl in the right directory and I changed it to the preferences suggested. I need to know some way of going about making a form work on here. Please help me! :confused:

Cota
05-11-2004, 11:06 PM
I'd suggest you use LoadVars()


on(release){
myData = New loadVars();
mydata.recipient = "myemail@mysite.com";
myData.subject = "Form Submission";
myData.onLoad = function(success) {
if(success){
//do something here
}
};
myData.Load(".../formmail.pl",myData, "POST");

walterppk
05-11-2004, 11:12 PM
may not be worth mentioning but common mistakes with mail forms are also

relative path:
so instead of ../formmail.pl -> http://www.fulldomain.com/pathtocgi/formmail.pl

secondly (sorry if this is insulting but I have supported these issues and this comes up again and again).

ensure that your formmail.pl does not give you internal server errors by sending an HTML form to it or tracing the value of the pl file like this:


plFileDisplay = myData.Load(".../formmail.pl",myData, "POST");
trace (plFileDisplay);

korai9989
05-12-2004, 09:02 AM
Yeah, I know, I put the entire url to the formmail. I didn't want to show it on here, I could have used a false name, but I was about to fall asleep when I posted, thanks. I'll try that when I get back to my computer. I'm willing to try almost anything now. I don't have alot of Flash experience, I am still in high school, but I'm tryin, thanks again. The actionscript that I used has worked before for me on a different website, I really don't understand the problems this time. Thanks though.

stealthelephant
05-12-2004, 03:10 PM
dont u want to send the info the the site the retreive something?
myData.sendAndLoad(...);

Cota
05-12-2004, 03:35 PM
Oh wow, thanks stealthelephant for pointing out that error, it should be myData.Send, not myData.Load

korai9989
05-12-2004, 06:22 PM
Where you put "// do something here" I really don't know what to put there. I am not experienced with actionscript at all.

Cota
05-12-2004, 08:24 PM
lets say you have a text box that you want to display a success message to the user, you can put the code for that there, if you dont want anything to happen, then you can omit that part all together.

korai9989
05-12-2004, 08:35 PM
thanks alot, now I just have to try it!

korai9989
05-12-2004, 08:40 PM
are you sure it is = New loadVars();
it reads that as an error.

Cota
05-12-2004, 10:29 PM
just small correction, its = new loadVars();
Not New, but new, watch the case.