Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jul 2009
    Thanked 0 Times in 0 Posts

    Embed Form ID into Flash

    I'm a web designer for a large nonprofit and I'm currently trying to test an email submission form we want to embed in a Flash Advertisement. Basically we will be placing our Flash ad on a large website and I just wanted to make sure a quick email signup was possible. I've used the guildelines outlined from tutorials like this one but have run into the problem that our Form Data Processor page (http://www2.aspca.org/site/Survey) needs a Form Id to be specified so it knows which survey to post the results to. In HTML, the form looks like this.

    <form name="survey_11460" id="survey_11460" method="POST" action="http://www2.aspca.org/site/Survey" >

    <table border="0" cellspacing="0" cellpadding="0">
    <tr valign="top">

    <td width="5%" class="req" align="right" nowrap="nowrap">

    <span class="Explicit">Your Info:</span><br />

    <table border="0" cellspacing="4" cellpadding="0">

    <tr style="position:absolute;left:-9999px">
    <td colspan="3">
    <input type="hidden" name="cons_info_component" id="cons_info_component" value="t" />
    <td width="1%">


    <td nowrap="nowrap">
    <p><label for="cons_email">Email: <span style="position:absolute;left:-9999px">Required</span></label></p>

    <input type="text" name="cons_email" id="cons_email" value=""
    maxlength="255" />
    <td width="1%">
    <td colspan="2">
    <input type="hidden" name="cons_mail_opt_in" id="cons_mail_opt_in" value="t" />
    <input type="checkbox" name="cons_email_opt_in" id="cons_email_opt_in" checked="checked" />

    <label for="cons_email_opt_in" class="wrapable">
    <span class="Explicit">Yes, I would like to receive updates about important animal cruelty and pet care news.</span></label>
    <input type="hidden" id="cons_email_opt_in_requested" name="cons_email_opt_in_requested" value="true" />
    <td width="1%">
    <td colspan="2">
    <input type="checkbox" name="s_rememberMe" id="s_rememberMe" checked="checked" />

    <label for="s_rememberMe" class="wrapable">
    <span class="Explicit">Remember me. <script> document.write('<a class="Smaller" title="View Privacy Policy (opens new window)" href="'); document.write("javascript:MM_openBrWindow('http://www2.aspca.org/site/PageServer?pagename=whatsthis&printer_friendly=1','Description','toolbar=no,scrollbars=yes,resizable =yes,alwaysRaised=yes,dependent=yes,width=700,height=500')"); document.write('">What\'s this?</a>'); </script> <noscript> <a class="Smaller" href="http://www2.aspca.org/site/PageServer?pagename=whatsthis&printer_friendly=1" title="View Privacy Policy (opens new window)" target="_blank" >What's this?</a> </noscript> </span>

    <a class="Smaller" title="View Privacy Policy (opens new window)"
    onclick="javascript:MM_openBrWindow('http://www2.aspca.org/site/PageServer?pagename=privacypolicy&printer_friendly=1','Description','toolbar=no,scrollbars=yes,resiz able=yes,alwaysRaised=yes,dependent=yes,width=700,height=500'); return false;"
    href="http://www2.aspca.org/site/PageServer?pagename=privacypolicy&printer_friendly=1" title="View Privacy Policy (opens new window)" target="_blank" > </a>


    <br />


    <td colspan="3" align="center">
    <input type="submit" name="ACTION_SUBMIT_SURVEY_RESPONSE" id="ACTION_SUBMIT_SURVEY_RESPONSE" value="Submit" class="Button" />

    <input type="hidden" name="SURVEY_ID" id="SURVEY_ID" value="11460" />
    <input type="hidden" name="USER_HAS_TAKEN" id="USER_HAS_TAKEN" value="null" />
    <input type="hidden" name="SURVEY_IGNORE_ERRORS" id="SURVEY_IGNORE_ERRORS" value="TRUE" />
    <input type="hidden" name="QUESTION_STAG_APP_ID" id="QUESTION_STAG_APP_ID" value="" />
    <input type="hidden" name="QUESTION_STAG_APP_REF_ID" id="QUESTION_STAG_APP_REF_ID" value="" />
    <input type="hidden" name="QUESTION_STAG_CTX_TYPE" id="QUESTION_STAG_CTX_TYPE" value="" />

    <input type="hidden" name="ERRORURL" id="ERRORURL" value="http://www2.aspca.org/site/PageServer?pagename=test_testy_test" />

    <span style="display:none">
    <table border="0"><tr><td>
    <label for="denySubmit">Spam Control Text:</label>&nbsp;
    <input type="text" name="denySubmit" id="denySubmit" value=""
    alt="This field is used to prevent form submission by scripts." />&nbsp;Please leave this field empty

    I'm new to Flash and am justing bumping my head into a wall looking at all the available online tutorials to even see if this is possible.

    Any help would be appreciated.

  2. AdSlot6
  3. #2
    Senior Coder gnomeontherun's Avatar
    Join Date
    Sep 2007
    Thanked 238 Times in 229 Posts
    If you need the ID from the form tag itself, then no. However if you need the values of the hidden input fields, that is possible.

    You will use the LoadVars.send method


    Quick example that you can build from

    var my_lv:LoadVars = new LoadVars();
    // Set variables for form
    my_lv.SURVEY_ID = "11460";
    my_lv.SURVEY_IGNORE_ERRORS = "true";
    my_lv.QUESTION_STAG_APP_ID = "";
    my_lv.QUESTION_STAG_APP_REF_ID = "";
    my_lv.QUESTION_STAG_CTX_TYPE = "";
    // Set variables from entry blanks
    my_lv.SURVEY_IGNORE_ERRORS = emailAddress.text;
    my_lv.send("setscore.cfm", "_blank", "POST");
    jeremy - gnomeontherun
    Educated questions often get educated answers, and simple questions often get simple answers.


Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts