PDA

View Full Version : Click Button/Image alternative



Webiter
08-10-2011, 12:46 PM
I use the following code to provide a button that refreshes a captcha image that a visitor may not be able to read.


<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
document.write('<input type=button value="Get new Code" onClick="history.go()">')
// End -->
</script>

I now wish to use a refresh <img src="refresh.jpg"> image as an alternative to the button to refresh the captcha image.
Can the <img src="refresh.jpg"> be incorporated into the Javascript as shown above?

XManBG
08-10-2011, 08:09 PM
Hi,

I'm not 100% sure, what are you looking for, but what about the normal way:


<img src="refresh.jpg" onclick="history.go()" alt="Get new Code" />

or


<a href="#" onclick="history.go()">
<img src="refresh.jpg" alt="Get new Code"/>
</a>

... and you can insert everything into your document, using document.write().
It is another question, why you are doing it this way... ?!

Cheers

Webiter
08-10-2011, 10:54 PM
Thanks XmanBG,

Your first code example done the trick. The image attached should answer your question - the installation of the refresh code arrow.:)