document.form1.text1.value="<?php$data->fetch("item")?>";
javascript error...
so i tried..
document.form1.text1.value="<?php$data->fetch(\"item\")?>";
output is:
(item)
on the browser but not the value of the item.
I also tried this
$value=$data->fetch("item");
document.form1.text1.value="$value";
returns an error
PHP does not know what
document.form1.text1.value is
and javascript dont understand
$value=$data->fetch("item");
is there a way we could integrate the two language?
Here's the rest of my code:
require("mydatabaseobjects.php");
$data = new odbc;
$data->connect("dns","someone","");
$data->getrecords("select * from table);
$data->firstrow();
<form name=form1>
<input type=text name=text><br>
<input type=button name=clickit onclick="getfield()">
</form>
/ everything works fine above exept the onlick event /
<script language="JavaScript">
document.form1.text1.value="<?php$data->fetch(\"item\")?>";
</script>
/ what can i do to make this work ? /
Please, if anyone has solved javascripts on php or vice versa, mail me... I would really appreciate it.
Sonny