Hide and Reveal Content, On Demand Reveal Form Example
A button is clicked to reveal a subscription form.
Example:
Ipsum lorum whatever. Ipsum lorum whatever. Ipsum lorum whatever. Ipsum lorum whatever. Ipsum lorum whatever. Ipsum lorum whatever. Ipsum lorum whatever. Ipsum lorum whatever. Ipsum lorum whatever.
Ipsum lorum whatever. Ipsum lorum whatever. Ipsum lorum whatever. Ipsum lorum whatever. Ipsum lorum whatever. Ipsum lorum whatever. Ipsum lorum whatever. Ipsum lorum whatever. Ipsum lorum whatever.
Here is the source code:
The form and DIV tag
<div id="emailform" style=" padding-right: 20px; float: left; display: none;"> <form method="POST" action="/cgi-bin/script.cgi"> <input type="input" name="email" size="33"><br> <input type="submit" value="Provide email and click this button."> </form> </div>
The "Want Subscription?" button and DIV tag
<div id="subask" style=" padding-right: 20px; float: left;"> <form> <input type="button" value="Want Subscription?" onclick="PresentForm('subask','emailform');"> </form> </div>
The JavaScript
<script type="text/javascript" language="JavaScript"><!-- function PresentForm(tid1,tid2) { document.getElementById(tid1).style.display = "none"; document.getElementById(tid2).style.display = ""; } //--></script>
Back to:
Hide and Display Content On Demand
Hide and Reveal Content, On Demand: How It Works
Will Bontrager