Custom Aweber Form

Discussion in 'PHP' started by aaron_nimocks, Jun 7, 2010.

  1. #1
    Ok this one is kicking my butt for some reason. I have an email form with Aweber and I cant get this to work right.

    <form method="post" class="af-form-wrapper" action="http://www.aweber.com/scripts/addlead.pl"  >
    <input type="hidden" name="meta_web_form_id" value="1757948816" />
    <input type="hidden" name="meta_message" value="1" />
    
    <label class="previewLabel" for="awf_field-6973267">Current Week:</label>
    <div class="af-selectWrap"><select id="awf_field-6973267" name="custom Current Week">
    <option class="multiChoice" value="7">1 Week</option>
    <option class="multiChoice" value="14">2 Weeks</option>
    <option class="multiChoice" value="21">3 Weeks</option>
    <option class="multiChoice" value="28">4 Weeks</option>
    <option class="multiChoice" value="5 Weeks">5 Weeks</option>
    <option class="multiChoice" value="6 Weeks">6 Weeks</option>
    <option class="multiChoice" value="7 Weeks">7 Weeks</option>
    <option class="multiChoice" value="8 Weeks">8 Weeks</option>
    <option class="multiChoice" value="9 Weeks">9 Weeks</option>
    <option class="multiChoice" value="10 Weeks">10 Weeks</option>
    <option class="multiChoice" value="11 Weeks">11 Weeks</option>
    <option class="multiChoice" value="12 Weeks">12 Weeks</option>
    <option class="multiChoice" value="13 Weeks">13 Weeks</option>
    <option class="multiChoice" value="14 Weeks">14 Weeks</option>
    <option class="multiChoice" value="15 Weeks">15 Weeks</option>
    <option class="multiChoice" value="16 Weeks">16 Weeks</option>
    <option class="multiChoice" value="17 Weeks">17 Weeks</option>
    <option class="multiChoice" value="18 Weeks">18 Weeks</option>
    <option class="multiChoice" value="19 Weeks">19 Weeks</option>
    <option class="multiChoice" value="20 Weeks">20 Weeks</option>
    <option class="multiChoice" value="21 Weeks">21 Weeks</option>
    <option class="multiChoice" value="22 Weeks">22 Weeks</option>
    <option class="multiChoice" value="23 Weeks">23 Weeks</option>
    <option class="multiChoice" value="24 Weeks">24 Weeks</option>
    <option class="multiChoice" value="25 Weeks">25 Weeks</option>
    <option class="multiChoice" value="26 Weeks">26 Weeks</option>
    <option class="multiChoice" value="27 Weeks">27 Weeks</option>
    <option class="multiChoice" value="28 Weeks">28 Weeks</option>
    <option class="multiChoice" value="29 Weeks">29 Weeks</option>
    <option class="multiChoice" value="30 Weeks">30 Weeks</option>
    <option class="multiChoice" value="31 Weeks">31 Weeks</option>
    <option class="multiChoice" value="32 Weeks">32 Weeks</option>
    <option class="multiChoice" value="33 Weeks">33 Weeks</option>
    <option class="multiChoice" value="34 Weeks">34 Weeks</option>
    <option class="multiChoice" value="35 Weeks">35 Weeks</option>
    <option class="multiChoice" value="36 Weeks">36 Weeks</option>
    <option class="multiChoice" value="37 Weeks">37 Weeks</option>
    <option class="multiChoice" value="38 Weeks">38 Weeks</option>
    <option class="multiChoice" value="39 Weeks">39 Weeks</option>
    <option class="multiChoice" value="40 Weeks">40 Weeks</option>
    <option class="multiChoice" value="41 Weeks">41 Weeks</option>
    <option class="multiChoice" value="42 Weeks">42 Weeks</option>
    </select>
    </div><input type="hidden" name="meta_preselected_awf_field-6973267" value=""/><div class="af-clear"></div></div><div class="af-element buttonContainer">
    <input name="submit" class="submit" type="submit" value="Submit"/>
    <div class="af-clear"></div>
    </div>
    </div>
    </div>
    <div style="display: none;"><img src="http://forms.aweber.com/form/displays.htm?id=jOys7JwsHByMbA==" alt="" /></div>
    </form>
    
    PHP:
    The part I am trying to change is a value that sends back to Aweber telling it what day to start the autoresponder on.

    <input type="hidden" name="meta_message" value="1" /> 
    PHP:
    Now I want that value to = the input value of the weeks dropdown I have on there. So if they select Week 4 then I want "meta_message" value to = 28 which is the value of that drop down.

    I only changed the first 4 weeks for demonstration purposes. Is javascript required for this since?

    Any help is appreciated!
     
    aaron_nimocks, Jun 7, 2010 IP
  2. MyVodaFone

    MyVodaFone Well-Known Member

    Messages:
    1,048
    Likes Received:
    42
    Best Answers:
    10
    Trophy Points:
    195
    #2
    I'm no expert, but since nobody else has replied here's my 2 cents :)

    Is the form file in a .html or .php ?

    For php you could try something like this:

    
    <input type="hidden" name="meta_message" value="<?  $_POST['custom Current Week'] ?>" />
    PHP:

    For a .html file, yeah I think you need javascript something like this:

    
    <script>
      function CopyValue(obj1, obj2)
      {
         var visibleField = obj1;
         obj2.value = visibleField.value;
      }
    </script>
    
    </head>
    
    
    <form method="post" class="af-form-wrapper" action="http://www.aweber.com/scripts/addlead.pl"  onSubmit="CopyValue(custom Current Week, meta_message)">
    <input type="hidden" name="meta_web_form_id" value="1757948816" />
    <input type="hidden" name="meta_message" value="" />
    
    <label class="previewLabel" for="awf_field-6973267">Current Week:</label>
    <div class="af-selectWrap"><select id="awf_field-6973267" name="custom Current Week">
    <option class="multiChoice" value="7">1 Week</option>
    <option class="multiChoice" value="14">2 Weeks</option>
    <option class="multiChoice" value="21">3 Weeks</option>
    <option class="multiChoice" value="28">4 Weeks</option>
    <option class="multiChoice" value="5 Weeks">5 Weeks</option>
    <option class="multiChoice" value="6 Weeks">6 Weeks</option>
    <option class="multiChoice" value="7 Weeks">7 Weeks</option>
    <option class="multiChoice" value="8 Weeks">8 Weeks</option>
    <option class="multiChoice" value="9 Weeks">9 Weeks</option>
    <option class="multiChoice" value="10 Weeks">10 Weeks</option>
    <option class="multiChoice" value="11 Weeks">11 Weeks</option>
    <option class="multiChoice" value="12 Weeks">12 Weeks</option>
    <option class="multiChoice" value="13 Weeks">13 Weeks</option>
    <option class="multiChoice" value="14 Weeks">14 Weeks</option>
    <option class="multiChoice" value="15 Weeks">15 Weeks</option>
    <option class="multiChoice" value="16 Weeks">16 Weeks</option>
    <option class="multiChoice" value="17 Weeks">17 Weeks</option>
    <option class="multiChoice" value="18 Weeks">18 Weeks</option>
    <option class="multiChoice" value="19 Weeks">19 Weeks</option>
    <option class="multiChoice" value="20 Weeks">20 Weeks</option>
    <option class="multiChoice" value="21 Weeks">21 Weeks</option>
    <option class="multiChoice" value="22 Weeks">22 Weeks</option>
    <option class="multiChoice" value="23 Weeks">23 Weeks</option>
    <option class="multiChoice" value="24 Weeks">24 Weeks</option>
    <option class="multiChoice" value="25 Weeks">25 Weeks</option>
    <option class="multiChoice" value="26 Weeks">26 Weeks</option>
    <option class="multiChoice" value="27 Weeks">27 Weeks</option>
    <option class="multiChoice" value="28 Weeks">28 Weeks</option>
    <option class="multiChoice" value="29 Weeks">29 Weeks</option>
    <option class="multiChoice" value="30 Weeks">30 Weeks</option>
    <option class="multiChoice" value="31 Weeks">31 Weeks</option>
    <option class="multiChoice" value="32 Weeks">32 Weeks</option>
    <option class="multiChoice" value="33 Weeks">33 Weeks</option>
    <option class="multiChoice" value="34 Weeks">34 Weeks</option>
    <option class="multiChoice" value="35 Weeks">35 Weeks</option>
    <option class="multiChoice" value="36 Weeks">36 Weeks</option>
    <option class="multiChoice" value="37 Weeks">37 Weeks</option>
    <option class="multiChoice" value="38 Weeks">38 Weeks</option>
    <option class="multiChoice" value="39 Weeks">39 Weeks</option>
    <option class="multiChoice" value="40 Weeks">40 Weeks</option>
    <option class="multiChoice" value="41 Weeks">41 Weeks</option>
    <option class="multiChoice" value="42 Weeks">42 Weeks</option>
    </select>
    </div><input type="hidden" name="meta_preselected_awf_field-6973267" value=""/><div class="af-clear"></div></div><div class="af-element buttonContainer">
    <input name="submit" class="submit" type="submit" value="Submit"/>
    <div class="af-clear"></div>
    </div>
    </div>
    </div>
    <div style="display: none;"><img src="http://forms.aweber.com/form/displays.htm?id=jOys7JwsHByMbA==" alt="" /></div>
    </form>
    
    Code (markup):
    It should copy the value of "custom Current Week" and put it into the value of "meta_message", have a mess-around with those two ideas they may need tweaking. Like the javascript might need id's to work with so add an id to meta_message id="meta_message" and change the onSubmit to onSubmit="CopyValue(awf_field-6973267, meta_message)"
     
    Last edited: Jun 8, 2010
    MyVodaFone, Jun 8, 2010 IP
  3. aaron_nimocks

    aaron_nimocks Im kind of a big deal Staff

    Messages:
    5,563
    Likes Received:
    627
    Best Answers:
    0
    Trophy Points:
    420
    #3
    Thanks, I figured it out an hour later.

    Using PHP wouldnt work but I got javascript to do the trick.
     
    aaron_nimocks, Jun 8, 2010 IP