Adding Image to Button fails to send to correct link

This works successfully:

<input type="button" name="search" value="Search Again" onclick="window.location.href='page.php?page=9';" style="margin:7px 0" style="padding:1px 2px 1px 2px">

When I try to add an image, and test it, it doesn’t take me to page.php?page=9 as before. Here’s the added image code:

<input type="image" src="/images/button2.png" name="search" value="Search Again" onclick="window.location.href='page.php?page=9';" style="margin:7px 0" style="padding:1px 2px 1px 2px">

If you could help me correct this, it would be greatly appreciated.

I am unable to duplicate the error, whats the URL that it sends you to?

BTW, IMHO, this could easily be a link and NOT a button.

Thanks for your reply.
It doesn’t send to a url, but to another page on the site :page=9

Please tell me what you mean by : IMHO, this could easily be a link and NOT a button
not clear on your meaning

It doesn’t send to a url, but to another page on the site page =9
that’s what a URL is, the address of any document on the web ( even within the same site)

Well I could be wrong as I would need to know the CONTEXT of this button. Am assuming, since you are using a redirect, and you don’t seem to have it pass any info, that you are not trying to resubmit the form ( which for search again, would be a bad idea!!!..see CONTEXT)

The action you want the button to perform is to go to another page/or location of the page , this is the VERY DEFINITION of a link.

So you could very well change the button to

<a href="page.php?page=9" class= "sa" >Search Again</a>

and then add this to your CSS

.sa{
margin:7px 0 ;
padding:1px 2px ;
height: 15px; /*height of your image*/
width: 15px; /*width of your image*/
overflow:hidden;
display: inline-block;
vertical-align:top;
}
.sa:before { content:url(/images/button2.png); display:block; }

But this is a gray which ,again, depends on the context you have put your button in