Hi,
May someone help me here. Am trying to read a database value in a javascript. I have used an alert() function to output the value passed from php to javascript. I get nothing in all my attempts. Someone help me.
I have only cut a piece of code that givens problem.
Thank you in advance.
Mutua
<script type=”text/javascript”>
function closeWin()
{
var myFileNoX = document.getElementById(‘fileNo’);
alert(myFileNoX.value);
close();
}
</script>
<!– form –>
<FORM NAME=”forward” ACTION=”<?php $_SERVER[‘PHP_SELF’]; ?>” METHOD=”POST” >
<table width=”75%” border=”1″ align=”center” >
<tr>
<td width=”196″><strong>File Number</strong></td>
<?php do { ?>
<td><?php echo $row_qry[‘fileNo’]; ?> </td>
<td>
<INPUT TYPE=”HIDDEN” NAME=”fileNo” id =”fileNo” value = “<?php $fileNo; ?>” >
<input type=”submit” value=”Select” onClick =”closeWin()” />
</td>
</tr>
<?php
} while ($row_qry = mysql_fetch_array($result)); ?>
</table>
</form>