hello
i have a javascript function like this:
function addfamily(divName){
var newdiv = document.createElement('div');
newdiv.innerHTML = "<input type='text' name='family[]' size='16'>";
document.getElementById(divName).appendChild(newdiv);
}
which dynamically adds textbox to the form and a php script like this:
<?php
$result__family = mysql_query("SELECT * FROM family_member where login_id='$_SESSION[id]'");
$num\_rows\_family = mysql\_num\_rows($result\_family);
if ($num\_rows\_family>0) {
while($row\_family = mysql\_fetch\_assoc($result\_family)){
echo "<script language=javascript>addfamily('family');</script>";
}
}
having this code the textboxes are added fine. i just need to know how can i set a dynamic value as the textbox value by passing the php variable $row_family[name] to the function and theb value of the textbox??? please help