Skip to main content
Participant
May 18, 2006
Question

send form contents to asp

  • May 18, 2006
  • 7 replies
  • 341 views
I am totally stuck. I have three form components, name, email, comments that I want to send to an embedded email address when someone clicks the submit button. My site is hosted on an .asp server that uses the AspMail component. I assume I have to extract the form components using action script and then send it to an asp page on my server which then sends it to the mail application on the server. But I have no idea how to do this. Please help!!!
This topic has been closed for replies.

7 replies

May 23, 2006
You should do some tutorials and/or read some articles so you have a better understanding of how this communication takes place. Try these...

http://www.flashmagazine.com/695.htm

http://www.adobe.com/devnet/flash/articles/flashpro_asp_02.html

http://flash-db.com/Tutorials/databind/CatalogTutorial.php?page=1

These should help you gain a better understanding of how to make flash communicate with scripts on your server.

Participant
May 19, 2006
I would if I knew how. I'm using a version of formmail that's encoded in asp. It should be all ready to go. I just can't figure out how to get the data out of flash and into the .asp page. All I need is 3 form fields with 5 hidden fields, but I'm not sure how to properly set up the hidden fields in flash. This was all a breeze in html, but it's really frustrating in flash. I really appreciate your help, though!!!
Participant
May 19, 2006
I'm also struggling with the stinking hidden fields. I made some text fields using the text tool and assigning them as Input Text in the properties section. I then assign an instance name and content in the variable box as the info I want sent with the hidden field. Is this the appropriate way to go about this? I've searched and searched on this topic but have not found an easy answer.
May 19, 2006
so is the data in your hidden text fields just static? if so why not just code it into your asp?
May 19, 2006
assuming your input fields are TextInput components.

formData.name = Name.text;
formData.email = Email.text;
formData.comments = Comments.text;

you would do the same sort of thing for your hidden fields depending what type of component they are.

then the variables that you will be requesting in your asp are name, email, comments and whatever other form data you send.
Participant
May 19, 2006
I'm slowly getting the hang of this. So, I do have an asp processing page and I want to send several form field contents, some user definable, some hidden, to the process page. Here's what my code looks like so far:

on (release) {
formData = new LoadVars();

//set your variables in your LoadVars Instance
formData.user = Name.text; //or whatever your form component is

//create LoadVars instance to receive reply
replyData = new LoadVars();
replyData.onLoad = myReplyFunction;

//submit the data
formData.sendAndLoad(" http://www.mysite.com/process.asp", replyData, "POST");
}

The visible form fields I have are Name, Email, Comments and the hidden fields are _recipients, _subject, _replyToField. How do I format the code properly to send all this data to my asp page? Thanks again for your help!!!
Participant
May 19, 2006
I don't know why this seems so hard. I'm using Flash 8 and I can't find the formData within the script wizard. Also, if I want to send this to an embedded email address, where and how do I put that within the script? Thanks in advance!
May 19, 2006
formData is just the variable name. In this case it is an instance of the LoadVars object.

I assumed you would be sending the email using your asp script. The only way I know how to email from flash is to use the getURL method with the URL being a mailto. ie. getURL("mailto:me@mydomain.com"); This would open up a new email message on the client, but that's what you want to send your form data out.

In my opinion your best option is to send the information to your asp page via the sendAndLoad method illustrated below and have your asp page send the email out.
May 18, 2006
use something like this:

formData = new LoadVars();

//set your variables in your LoadVars Instance
formData.user = name_txt.text; //or whatever your form component is

//create LoadVars instance to receive reply
replyData = new LoadVars();
replyData.onLoad = myReplyFunction;

//submit the data
formData.sendAndLoad(" http://www.mysite.com/myformhandler.asp", replyData, "POST");