multiple redirirects on aWeber subscribe form depending on list selection

1 replies
I removed the hidden field for the listname from an aWeber form and added a select list like this:
Code:
  <select name="listname">
  <option disabled="disabled">Please select the
information you want</option>
  <option value="awlist101">MyList1</option>
  <option value="awlist102">MyList2</option>
  <option value="awlist103">MyList3</option>
  </select>
What I'd like to do is change the redirect that happens depending on which list is selected.
Here is their redirect line:
Code:
<input type="hidden" name="redirect" value="http://somesite.net/dnlEbook1" id="redirect_f81758ee65419f10d612639150e10561" />
Assuming I want them to go to somesite/dnlEbook1 if the selected listname is MyList1 and somesite/dnlEbook2 if it is MyList2 etc. how would I change this?
#aweber #depending #form #list #multiple #redirirects #selection #subscribe
  • Profile picture of the author littleCowCoding
    Hopefully this should get you started

    Code:
    <select onchange="listName()" id="chooseaList">
      <option value="awlist101" selected>MyList1</option>
      <option value="awlist102">MyList2</option>
      <option value="awlist103">MyList3</option>
      </select>
      <input type="hidden" name="redirect" value="http://www.reDirectNo1.com" id="redirectOnSubmit" />
      <script>
    	function listName(){
    		var e = document.getElementById("chooseaList");
    		var selection = e.options[e.selectedIndex].value;
    		var reDirLink = document.getElementById("redirectOnSubmit");
    		switch (selection)
    		{
    			case "awlist101":
    				reDirLink.value = "http://www.reDirectNo1.com";
    			break;
    			case "awlist102":
    				reDirLink.value = "http://www.reDirectNo2.com";
    			break;
    			case "awlist103":
    				reDirLink.value = "http://www.reDirectNo3.com";
    			break;
    			default:
    			reDirLink.value = "http://www.reDirectNo1.com";
    		}
    	}
      </script>
    {{ DiscussionBoard.errors[9323377].message }}

Trending Topics