Skip to main content
April 11, 2007
Question

Earthlink CGI script and Flash

  • April 11, 2007
  • 95 replies
  • 24236 views
I've created a contact form in Flash and the script can't find the URL at Earthlink. I've talked to EL and they said use the EL CGI html code and incorporate in the Flash script. I tried a multitude of ways and get constant syntax errors. My code has no errors but can't find the URL. I've attached my code and Earthlink's sample code. Can someone show me where to put what?
Thanks for any and all help.

Earthlink's code:
<h1>Sample Form</h1>
<hr>
<form method="post" action=" http://www.domain.com/cgi-bin/mailto"> 
<input type="hidden" name="RECIPIENT" value="user@domain.com"> 
<input type="hidden" name="THANKURL" value=" http://www.domain.com/thankyou.html"> 
<p> 
<b>Name:</b><input type="text" name="name" size="30"><br> 
<b>Email:</b><input type="text" name="email" size="30"><p> 
<b>Comments:</b><br> 
<textarea name="comments" rows="10" cols="50"></textarea>
<p> 
<input type="submit" value="Send"> 
<input type="reset" value="Clear"> 
</form> 
<p>


My Flash Code:
stop();

send_btn.onRelease = function() {
var my_lv:LoadVars = new LoadVars();

my_lv.firstName = firstName_txt.text;
my_lv.lastName = lastName_txt.text;
my_lv.email = email_txt.text;
my_lv.phone = phone_txt.text;

if (firstName_txt.text != "" && lastName_txt.text != "" && email_txt.text != "" && comments_txt.text != "")
{
my_lv.send(" http://www.domain.us/cgi-bin/mailto:me@domain.us","_blank","POST");
gotoAndStop("success");
}
else
{
gotoAndStop("error");
}
}
This topic has been closed for replies.

95 replies

April 22, 2007
Still the same. Only thing that shows up related to the cbs is one "cb:Yes".
April 22, 2007
Yes there are. I'll fix and let you know.
kglad
Community Expert
Community Expert
April 22, 2007
are there any spaces or other characters in their names that would cause a problem when used as a property?
April 22, 2007
They all have different names. Extended versions of the instance name. There is nothing attached to the checkboxes.
kglad
Community Expert
Community Expert
April 22, 2007
do each of your checkboxes have a label that's the same as their instance name or, at least, different from one another?

do you have any other code affecting your checkboxes like an onClick method (which you should not have).
kglad
Community Expert
Community Expert
April 22, 2007
well, if i got a penny for every message i'd have over $200 and that would be $200 more than i actually get.

but i knew that before i answered any questions.

and you're welcome.
April 22, 2007
I'm sending this again, I don't think the first one went through. I guess I spoke too soon about getting it! I've attached my code. Do I have the "cbListener" backwards with the instance name? The only thing that shows up on the form is "cb:Yes" once. And it doesn't matter if the boxes are checked or not, just one "cb:Yes". Should I have attached a "onClick" funtion to each box?
April 22, 2007
Gotcha! I'm finally grasping the concept. Finally! I sure hope someone is paying you big bucks for all your free expertise. If not, you're a Master and a SAINT! Thanks, again.
kglad
Community Expert
Community Expert
April 22, 2007
no. you only need to add the same event listener to each event object or checkbox.

so, you should have one loadvars (lv), one event listener (gcdesignListener), and one listener method (gcdesignListener.click).

your choice of name for the listener may confuse you. you might want to change that back to lo (just a plain old vanilla listenerobject). or you could call it cbListener (for checkbox listener), if you like fancier names.
April 22, 2007
Should I also repeat this top code for each checkbox?
gcdesignListener = new Object(); / / ie:1,2,3
lv=new LoadVars();
gcdesignListener.click = function(eo:Object) {
if (eo.target.selected) {
cb = eo.target.label;
lv.cb = "yes";
April 21, 2007
There are actually 4 checkboxes. Should I just repeat each as shown? And just change each checkbox name?
kglad
Community Expert
Community Expert
April 21, 2007
instead of

gcdesign.addEventListener("click", gcdesignListener);

you should have four lines like: