can you do THIS with an OPT-IN from icontact?

claywalsh

New member
Dec 9, 2008
48
0
0
I'm using an icontact opt-in form. (icontact.com)

People enter name, email, and choose a certain value from a drop down menu.

I would like to alter the code so the page they are redirected to (after opt-in) is different based on the value they choose. For some reason icontact told me they couldn't do this, but it doesn't seem so complex.



Here's the code

<form method=post action="https://app.icontact.com/icp/signup.php" name="icpsignup" id="icpsignup3720" accept-charset="UTF-8" onsubmit="return verifyRequired3720();" >
<input type=hidden name=redirect value="www.LOCATION-AFTER-OPT-IN.com" />
<input type=hidden name=errorredirect value="www.LOCATION-AFTER-ERROR.com" />

<p class="a">
<label>NAME:</label>
<input type=text name="fields_fname">
</p>

<p class="b">
<label>EMAIL:</label>
<input type=text name="fields_email">
</p>

<p class="c">
<label>AMOUNT NEEDED:</label>
<select name="fields_lname">
<option></option>
<option value="5">$500</option>
<option value="6">$600</option>
<option value="7">$700</option>
<option value="8">$800</option>
<option value="9">$900</option>
<option value="10">$1000</option>
<option value="11">$1500</option>
<option value="12">$2000</option>
<option value="13">$2500</option>
<option value="14">$5000</option>

</select>
</p>
<input type=hidden name="listid" value="36210">
<input type=hidden name="specialid:36210" value="GNW1">

<input type=hidden name=clientid value="600030">
<input type=hidden name=formid value="3720">
<input type=hidden name=reallistid value="1">
<input type=hidden name=doubleopt value="0">

<p class="d">
<input type="submit" name="Submit" value="ENTER">
</p>

</form>
<script type="text/javascript">

var icpForm3720 = document.getElementById('icpsignup3720');

if (document.location.protocol === "https:")

icpForm3720.action = "https://app.icontact.com/icp/signup.php";
function verifyRequired3720() {
if (icpForm3720["fields_email"].value == "") {
icpForm3720["fields_email"].focus();
alert("The Email Address field is required.");
return false;
}


return true;
}
</script><BR>



so somehow, I need this to be something like:


If option 5, redirect them _______________
if option 6, redirect them ________________


this way I can customize where people go after opt-in, based on their choice.

Thanks in advance If anyone can throw me a bone!

CW



:bowdown:
 


Use the POST global variable array to grab the form data and see if you can get the variables from it after the redirect. Some mailers will keep them in the array. You can easily do this with PHP and see if they pass by putting this code on your page that shows after the redirect.

Code:
<?php print_r($_POST); ?>
If you can't see any of your form variables passing, then do as sgtryan suggested and tag some variables onto the URL for the redirect and access them from there.
 
You could always do this in javascript, right before the form is submitted use jquery or whatever to determine which option they selected, and then update the redirect variable in the form to whatever you want it to be. In other words you are deciding on the redirect URL before you submit the form to them, not after.
 
Look at what you have now and everything you need is pretty much there to do this in JavaScript.

When they submit the form you would want to execute this javascript -

icpForm3720["redirect"].value = icpForm3720["redirect"].value + '?redirect=' + icpForm3720["fields_lname"].value;


Then your redirect page has a url parameter with the value for redirection.


The only strange thing I see is that you call a dropdown list containing dollar amounts "lname" which is always used for last name in forms.