Hello, How can I get my PHP variable values to a javascript?
Here's the code: <SCRIPT> function btnOKClick($file) { DO STUFF TO IMAGE /<SCRIPT> <input type="submit" name="btnOK" value="OK" onClick="javascript:btnOKClick($txtFileName)"> <BUTTON ID=btnCancel type=reset onClick="window.close();">Cancel</BUTTON> <?php $sql="SELECT * FROM images ORDER BY 'date' DESC"; $result=mysql_query($sql); $num = mysql_num_rows($result); $cur = 1; while ($num >= $cur) { $row = mysql_fetch_array($result); $id = $row["id"]; $iso = $row["iso"]; $thumpnail = $row["thumpnail"]; $date = $row["date"]; echo "<div class=\"float\">"; echo "<div align=\"center\"><img src=\"$thumpnail\"></a><br /></div>"; echo "<div align=\"left\">$ladattu</div>"; // File path as value here. I need to send this to Javascript echo "<div align=\"left\"><input type=\"checkbox\" name='txtFileName' value='$thumpnail'>ADD</div>"; // File path as value here. I need to send this to Javascript echo "</div>"; $cur++; } ?> There's two buttons OK/Cancel at the top of the page. Then image thumpnails are looped to screen as many times there are DB entries. Under each thumpnail there's checkbox with ADD text. The checkbox value is/should be path to the image file. So I need this path info in the javascript to handle the image when user clicks OK button but I don't know how? Thanks -Will -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php