Skip to content

Instantly share code, notes, and snippets.

@willwright82
Created July 3, 2014 12:18
Show Gist options
  • Save willwright82/62f6aed6ffbd28cb9789 to your computer and use it in GitHub Desktop.
Save willwright82/62f6aed6ffbd28cb9789 to your computer and use it in GitHub Desktop.
Multi Step Form
<form action="http://www.aweber.com/scripts/addlead.pl">
<div id="form_part1">
Name: <input name="name">
Email: <input name="from">
<button
onclick="openForm_part('form_part', 2)"
>Next »</button>
</div>
<div id="form_part2">
Phone: <input name="phone">
Skype: <input name="skype">
IM: <input name="im">
<button
onclick="openForm_part('form_part', 3)"
>Next »</button>
</div>
<div id="form_part3">
Street: <input name="street">
City: <input name="city">
State: <input name="state">
Zip: <input name="zip">
<input type="submit" value="Subscribe">
</div>
<script type="text/javascript">
<!--//
function openForm_part(part_name, part_number) {
for (var p = null, i = 1;
p = document.getElementById(part_name+i); ++i) {
if (i == part_number) p.style.display = "";
else p.style.display = "none";
}
}
window.onload = function() {
openForm_part("form_part", 1);
}
//-->
</script>
</form>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment