How do I add descriptive text to form link .gif?
I want to make the descriptive text around a form link also open the form. I want to make it so you can click on "Some Text Here" (below) and open the form on somesomite.com just as if you clicked on the image below开发者_开发技巧 this text (somebut.gif, below)
<DIV style="position: absolute; top:10px; right:10px; width:70px; height:25px">
<font color="white"><b>Some Text Here<b></font>
</div>
<DIV style="position: absolute; top:50px; right:10px; width:70px; height:25px">
<form action="https://www.somesite.com/cgi-bin/something" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="image" src="https://www.somesite.com/somebut.gif" border="0" name="submit">
<input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----LONG_KEY...>
</form>
</div>
Thanks
Give the form a name and use JavaScript to submit the form. You should also stay away from <font>
and <b>
tags; they're deprecated.
<!-- ... snip ... -->
<strong style="cursor: pointer; color: #FFF; " onclick="document.forms['someform'].submit(); ">Some Text Here</strong>
<!-- ... snip ... -->
<form name="someform" action="https://www.somesite.com/cgi-bin/something" method="post">
<!-- ... snip ... -->
If you prefer to use anchor tags to get all of the CSS pseudo-classes, etc., then you can do this instead of the bare <strong>
tag:
<a href="#" style="font-weight: bold; text-decoration: none; color: #FFF; " onclick="document.forms['someform'].submit(); return false; ">Some Text Here</a>
Finally, if you don't want to use JavaScript, then you'll have to do some rearranging of your markup and add some CSS, like so:
<form action="https://www.somesite.com/cgi-bin/something" method="post">
<input type="submit" value="Some Text Here" style="background: none; border: 0; font-weight: bold; color: #FFF; " />
<input type="hidden" name="cmd" value="_s-xclick" />
<input type="image" src="https://www.somesite.com/somebut.gif" border="0" name="submit" />
<input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----LONG_KEY..." />
</form>
Add <div>
tags as desired.
just wrap the "some text here with a link to the site"
<a href="https://www.somesite.com/cgi-bin/something"><font color="white"><b>Some Text Here<b></font></a>
精彩评论