I am looking to showcase the image provided below.
<img src="http://gfx.myview.com/MyView/skins/livesample/image/livesample.gif" alt="" border="0"><a/>
Once the image is clicked, I want it to execute the following code. How can I ensure that only the image is visible initially, and when clicked, the remaining code opens up a form as intended?
<script type="text/javascript>
function navigateToPage() {
var s1 = document.getElementById('s1').value;
var s2 = document.getElementById('s2').value;
var s3 = document.getElementById('s3').value;
var s4 = document.getElementById('s4').value;
window.location = "http://igaintrk.com/?E=BjcJU6NSsab3xCmBOyZgJw%3d%3d&s1=" + s1 + "&s2=" + s2 + "&s3=" + s3 + "&s4=" + s4 ;
}
</script>
Please provide the following information:
<label for="s2">First Name:</label>
<input type="text" id="s2" />
<label for="s3">Last Name:</label>
<input type="text" id="s3" />
<label for="s1">E-mail:</label>
<input type="text" id="s1" />
<label for="s4">Zipcode:</label>
<input type="number" id="s4" />
<a href="JavaScript:navigateToPage()"><img src="http://gfx.myview.com/MyView/skins/livesample/image/livesample.gif" alt="" border="0"><a/>
<script type="text/javascript>
var formValidator = new Validator("myform");
formValidator.addValidation("FirstName","req","Please enter your First Name");
formValidator.addValidation("FirstName","maxlen=20",
"Maximum length for FirstName is 20");
formValidator.addValidation("LastName","req");
formValidator.addValidation("LastName","maxlen=20");
formValidator.addValidation("Email","maxlen=50");
formValidator.addValidation("Email","req");
formValidator.addValidation("Email","email");
formValidator.addValidation("Zipcode","maxlen=5");
formValidator.addValidation("Zipcode","req");
</script>