My code is

<script type="text/javascript" language="javascript"> 

function displayHideBox(boxNumber) 
{ 
    if(document.getElementById("LightBox"+boxNumber).style.display=="none") 
    { 
        document.getElementById("LightBox"+boxNumber).style.display="block"; 
        document.getElementById("grayBG").style.display="block";
        document.getElementById('t').value; 
    } else { 
        document.getElementById("LightBox"+boxNumber).style.display="none"; 
       document.getElementById("grayBG").style.display="none";          
    } 
} 
</script> 


<style> 
.grayBox{ 
    position: fixed; 
    top: 0%; 
    left: 0%; 
    width: 100%; 
    height: 100%; 
    background-color: black; 
    z-index:1001; 
    -moz-opacity: 0.8; 
    opacity:.80; 
    filter: alpha(opacity=80); 
} 
.box_content { 
    position: fixed; 
    /*top: 55%; 
    left: 50%; 
    right: 30%; 
    width: 80%;*/
    width:400px;
    height:400px;
    padding: 16px; 
    z-index:1002; 
    overflow: auto;
    border:solid thin #0C9;
    background-color:#0FC;
} 
</style> 


<body> 
<div id="grayBG" class="grayBox" style="display:none;"></div> 

       <div id="LightBox1" class="box_content" style="display:none;">

<table cellpadding="3" cellspacing="0" border="1" height="300"> 
  <tr align="left"> 
    <td colspan="2" bgcolor="#FFFFFF" style="padding:10px;">
    <div onclick="displayHideBox('1'); return false;" style="cursor:pointer;" align="right">X</div><p>
     <!-- Box content -->Text of the box!!!</p>
    </td> 
  </tr> 
</table> 

</div> 

 <form action="#" method="post" onsubmit="displayHideBox('1');return false">  
<input type="text" id="t" value="" />
<input type="submit" name="submit" value="submit" />    
</form>

</body>



I want to pass the data from text box in form to lightbox and display on light box..using the value,want to fetch data from database ....Any help is highly appreciated.

Finally i found it...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.