setting src value for image control ( Urgent )
Hi,
I wrote a javascript function to set some value for a image control. Please
look at the following...
function checkfun(num)
{
strtmp = "document.form1.srcimg"+num+".nameProp"
alert(eval(strtmp))
if( eval(strtmp) == "check3.gif")
{
alert( "I came here")
// eval(strtmp) = "check4.gif"
}
else
{
alert("I came here. but, how to set value to the same control...strtmp?")
// eval(strtmp) = "check4.gif" //failed
//I can not do the below because name of the control changes
// document.form1.srcimg.src = "check3.gif"
}
}
where srcimg1, srcimg2, srcimg3.... are different image controls. I want
to chage the image by checking.
If the current image is check3.gif, i change it to check4.gif
If the current image is check4.gif, i change it to check3.gif
I have written above function for all the image controls and calling the
above routine at onclick event of the image control.
I could able to check the value using eval() function..
But I am unable to set the new value..
How can I set src to a particular selected control..?
Please let me know
regards
Kiran