minazfath
01-17-2012, 03:58 PM
Store Information to multiple textboxes from database
$count=<mysql_num_rows($query1);
for($i=0;$i<mysql_num_rows($query1);$i++)
{
$row1=mysql_fetch_array($query1);
$getval[$i]=$row1[UserId];
Print "<input type=text name='txtbox[]' id='txtbox[]' value='.$getval[$i].'">;
}
then i call a javascript function
Print "<script language=javascript>Call_Fun($count)</script>";
The above code store data into textbox and call the js function
in .js file
function Call_Fun(count)
{
for(var i=0;i<count;i++)
{
alert(document.getElementbyId('txtbox')+i.value);
}
}
But it doesn't retreive values in .js
Thankyou all
$count=<mysql_num_rows($query1);
for($i=0;$i<mysql_num_rows($query1);$i++)
{
$row1=mysql_fetch_array($query1);
$getval[$i]=$row1[UserId];
Print "<input type=text name='txtbox[]' id='txtbox[]' value='.$getval[$i].'">;
}
then i call a javascript function
Print "<script language=javascript>Call_Fun($count)</script>";
The above code store data into textbox and call the js function
in .js file
function Call_Fun(count)
{
for(var i=0;i<count;i++)
{
alert(document.getElementbyId('txtbox')+i.value);
}
}
But it doesn't retreive values in .js
Thankyou all