In this code i want to pass all the three red color code textbox value to a javascript function and print there.
<?php
$userid="123456789123456789";
$con = mysql_connect('localhost', 'root', ''); //Update hostname
mysql_select_db("video_upload", $con); //Update database name
//echo "--------".$viewall = $_GET['viewall'];
//Display image
$rs=mysql_query("select * from video ");
while($row=mysql_fetch_array($rs))
{
echo "<table width=\"600\">";
echo "<tr>";
echo "<td width=\"350\">";
echo $row['filename'];
echo "</td>";
echo "<td width=\"100\">";
var art= echo "[color=red]<input type=\"text\" value=\"Artist\" name=\"artist\" size=\"15\" id=\"artist\" onblur=\"if(this.value == '') { this.value = 'Artist'; }\" onfocus=\"if(this.value == 'Artist') { this.value = ''; }\" />[/color]";
echo "</td>";
echo "<td width=\"100\">";
var gen= echo "[color=red]<input type=\"text\" size=\"15\" value=\"Genere\" name=\"genere\" id=\"genere\" size=\"15\" onblur=\"if(this.value == '') { this.value = 'Genere'; }\" onfocus=\"if(this.value == 'Genere') { this.value = ''; }\" />[/color]";
echo "</td>";
echo "<td width=\"50\">";
$var=$row['filename'];
echo "[color=red]<input type=\"hidden1\" value=\"$var\" id=\"filename\" name=\"filename\" />[/color]";
echo "<input type=\"submit\" value=\"save\" id=\"$var\"[color=blue][color=red] onclick=\"savedata1(id)\"[/color][/color] />";
echo "</td>";
echo "</tr>";
echo "</table>";
echo "<br />";
}
mysql_close($con);
?>
function savedata1(id)
{
alert(id);
var artist=document.getElementById("artist").value;
var filename=document.getElementById("filename").value;
//alert(filename);
var genere=document.getElementById("genere").value;
</script>