Hi there, I'm having some trouble getting an image to be clickable when using Javascript. What I am trying to do is have a check box as an electronic signature. I have the script to do the href (link) as a simple button with text on, but I want to make it an image instead, I've spent 3- 4 hours trying to find out how to do it and have tried messing with it to see what would happen and I think I git close. Here's where I am so far - HEAD - <script language="JavaScript"> function purchase() { if (window.document.the_form.question.checked == true) { document.location.href = "http://1.xxxxxxxxxx.pay.clickbank.net"; } else { alert("Please Check the Box to Signify Agreement of Our Terms of Use."); } } </script> BODY - <form name="the_form"> <p align="center"><input name="question" value="ON" type="checkbox"> <font face="Verdana, Arial, Helvetica, sans-serif" size="2">I have Read and Agree to the <a target="_blank" href="http://www.gurugrimmer.com/Leg%20Dox%20good%20HHME/TermsofUse_and_All_Disclaimers.html">Purchase Agreement</a> Terms. </font></p> <p align="center"> <input value="img" src="add-2-cart-big.jpg" alt="ADD TO CART" onclick="purchase();" height="64" type="image" width="400"></p> If any of you awesome chaps can see what's wrong with that, I'd be very grateful. The original coding before I messed with it was. HEAD - <script language="JavaScript"> function purchase() { if (window.document.the_form.question.checked == true) { document.location.href = "YOUR-URL-HERE"; } else { alert("Please Check the Box to Signify Agreement of Our Terms of Use."); } } </script> BODY- <form name = "the_form"> <P align=center> <input type = "checkbox" name = "question" value="ON"> <font face="Verdana, Arial, Helvetica, sans-serif" size="2">I have Read and Agree to the <a target="_blank" href="URL-OF-YOUR- AGREEMENT-HERE">Purchase Agreement</a> Terms. </font></P> <P align=center> <input type = "button" value = "WHAT-YOU-WANT-THE- BUTTON-TO-SAY-HERE" onclick = "purchase();"></P> <P> </P> </form> for any of you that don't know how to do electronic signatures - that is very useful information!! : ) Matthew - aka Guru Grimmer
i would change the image from being inside an input tag , and have it inside an img tag instead. so change this: <input value="img" src="add-2-cart-big.jpg" alt="ADD TO CART" onclick="purchase();" height="64" type="image" width="400"> Code (markup): to this line of code instead, and it will work as expected: <img src="add-2-cart-big.jpg" alt="ADD TO CART" onclick="purchase()" height="64" width="400" /> Code (markup):