i am using a javascript fuction for light box and pass variable
<a href="#" onclick="vipin('<%# Eval("flightid") %>',0)" ><asp:ImageButton ID="ImageButton2" runat="server" ImageUrl="images/book1.gif" />a>
now i want to give filghtid in a label but when i insert the code in javascript funtion lightbox did not show the javacript is
function gradient(id, level)
{
var box = document.getElementById(id);
box.style.opacity = level;
box.style.MozOpacity = level;
box.style.KhtmlOpacity = level;
box.style.filter = "alpha(opacity=" + level * 100 + ")";
box.style.display="block";
return;
}
function fadein(id)
{
var level = 0;
while(level <= 1)
{
setTimeout( "gradient('" + id + "'," + level + ")", (level* 1000) + 10);
level += 0.01;
}
}
// Open the lightbox
function openbox(formtitle, fadin )
{
var box = document.getElementById('box');
document.getElementById('filter').style.display='block';
var btitle = document.getElementById('boxtitle');
btitle.innerHTML = formtitle;
if(fadin)
{
gradient("box", 0);
fadein("box");
}
else
{
box.style.display='block';
}
document.getElementById('Label1').value=formtitle;
}
// Close the lightbox
function closebox()
{
document.getElementById('box').style.display='none';
document.getElementById('filter').style.display='none';
}
function vipin (formtitle, fadin )
{
openbox(formtitle, fadin );
}
please see it and tell me solution
Loading
hariomPosted Sep 6, 2010, 5:34 AM
by :document.getElementById('Label1').innerHtml=formtitle;
vipin sainiPosted Aug 30, 2010, 8:24 AM
this line is not working i put alert once before it and once after is before give responce but after do not give responce.
Manikavelu VelayuthamPosted Aug 30, 2010, 7:58 AM
vipin sainiPosted Aug 30, 2010, 7:49 AM
Manikavelu VelayuthamPosted Aug 30, 2010, 7:42 AM
It should work, because label control will be generated as SPAN html tag, it dont have the value properties. so we need to assign it to the innerText.
Mark this post as answered, if this post really helps you.