Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 Other Development Tools
 change image when i click

Author  Topic 

Mamatha
Posting Yak Master

102 Posts

Posted - 2005-01-23 : 04:02:50
Hi
i have an application in ASP,in that application i have two image buttons as a hyperlink.If i click on particular button,the image on button will change,because to know which button i was clicked.How can i change,i know this is possible through javascript but i don't how can we write in javascript,please give me the solution.
Thanks in advance.

Mamatha

chadmat
The Chadinator

1974 Posts

Posted - 2005-01-24 : 18:03:24
I don't get it? It currently changes, or it doesn't and you want it to? Or it does on 1 button, and you want it to on the other? Please clarify.

-Chad

http://www.clrsoft.com

Software built for the Common Language Runtime.
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2005-01-24 : 18:35:09
i think you need onMouseOver() event
<img id="id1" onMouseOver="some javascript code"></img>

Go with the flow & have fun! Else fight the flow
Go to Top of Page

zpnasium

11 Posts

Posted - 2005-01-25 : 03:22:58
You are going to want to use an onClick. So when a use clicks on the button, you switch the image with the clicked image. Here is rough example.

<SCRIPT LANGUAGE="JavaScript">
<!--
image_1 = new Image(100,28)
image_1.src = "./images/products.gif"
-->
</SCRIPT>
<A href="" onClick="document.image1.src='click.gif'";><IMG src="products.gif" border="0" name="image1"></A>


Go to Top of Page
   

- Advertisement -