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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Submitting Form problem

Status
Not open for further replies.

Joshua61679

Technical User
Dec 28, 2001
36
US
I'm getting the strangest thing, and I haven't been able to find anything on it.

I've created a form in Flash MX. When I hit Its got some fields, and at the bottom a submit button. Here's the action script I'm using for the button.
Code:
on (press) {
	set ("recipient", "jcoffee@superiorwells.com");
	set ("redirect", "");
	loadVariables ("[URL unfurl="true"]http://www.superiorwells.com/cgi-bin/formmail.pl",[/URL] "", "POST")
}

on (release) {
	_root.content.loadMovie ("/Thankyou.swf")
}

The problem is that the e-mail that is sent only contains the properties of the button, and not anything from the form that I want. It's quite possible I'm doing something stupidly simple wrong. Any help would be much appreciated.
 
Ok, decided to try this using a function and dataSend and it worked. To do that, in the first frame of the timeline a created the function doSend.
Code:
function doSubmit () {
	formData=new LoadVars(this);
	
	formData.recipient="jcoffee@superiorwells.com";
	formData.redirect="[URL unfurl="true"]http://www.superiorwells.com/Thankyou1.htm";[/URL]
	formData.Name=this.Name.text;
	formData.Email=this.Email.text;
	formData.NatureOfComment=this.Why.getValue();
	formData.Area=this.Area.getValue();
	formData.Response=this.Response.getValue();
	formData.Comment=this.Comment.text;
	
	formData.send ("[URL unfurl="true"]http://www.superiorwells.com/cgi-bin/formmail.pl",[/URL] "0", "POST")
	
}
Then for the submit button did an onClick...
Code:
on (click) {
	_root.doSubmit();
}
Had to throw a this._lockroot into the timeline as well, since I couldn't get the function to run as this.doSubmit. Hope this saves some headaches for someone else trying to figure out a similar problem.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top