J
Joe
I have a function that changes an image when the user clicks a button (this
works fine). There's another button that is used to transfer to another page
an pass the selected image as a querystring. The problem is in the code
behind, Image1.ImageUrl always returns the initial image name. Is there a
way to get the newly selected one?
<script language="javascript">
<!--
var Images = new Array();
Images[0] = "Image1.jpg";
Images[1] = "Image2.jpg";
Images[2] = "Image3.jpg";
var Index = 0;
function ChangeImage(forward)
{
if (forward == true)
{
if (Index >= Images.length - 1)
Index = 0;
else
Index++;
document.frmFriend.Image1.src = Images[Index];
}
else
{
if (Index == 0)
Index = Images.length - 1;
else
Index--;
document.frmFriend.Image1.src = Images[Index];
}
}
//-->
</script>
works fine). There's another button that is used to transfer to another page
an pass the selected image as a querystring. The problem is in the code
behind, Image1.ImageUrl always returns the initial image name. Is there a
way to get the newly selected one?
<script language="javascript">
<!--
var Images = new Array();
Images[0] = "Image1.jpg";
Images[1] = "Image2.jpg";
Images[2] = "Image3.jpg";
var Index = 0;
function ChangeImage(forward)
{
if (forward == true)
{
if (Index >= Images.length - 1)
Index = 0;
else
Index++;
document.frmFriend.Image1.src = Images[Index];
}
else
{
if (Index == 0)
Index = Images.length - 1;
else
Index--;
document.frmFriend.Image1.src = Images[Index];
}
}
//-->
</script>