Ok, I'm trying to figure how It would be possible to firstly change and img from one to another and then send an on value to a db or text file which would check to see if it had been turned on each time the page loads and change the img accordingly.
I hope that I'm making sense, basically I'm trying to make an image checkbox which remembers if it is checked or not.
I've tried to change the image like this but it doesn't seem to work:
Code:
<%
dim Img1
dim Img2
dim CurrentImg
Img1 = Server.MapPath(/off.png)
Img2 = Server.MapPath(/onn.png)
CurrentImg = Img1
%>
<%
dim ThisUrl
ThisUrl = "http://127.0.0.1/m5/personal/chbx/chbx.asp?ch1=on"
dim img1
dim img2
dim currentimg
img1 = server.MapPath("off.png")
img2 = server.MapPath("onn.png")
currentimg = img1
if Request.QueryString("ch1") = "on" then
currentimg = img2
end if
%>
One way, you could have a form with a hidden field, and post that - when you click the image, have javascript change the value of that (hidden) field - then you could get the value of the variable with Request.Form("myhiddenfieldname")
__________________
Former ASP Forum Moderator - I'm back!
If you can teach yourself how to learn, you can learn anything. ;)
Oh... so you wish not to have a querystring, eh?
Why not send it as a form. (Method="post")
Then you can do something like: String = Request.Form("ch1")