What you are trying to do can not be done the way you think..
You can do an onClick that submits the page and that page writes the information you need.
<SCRIPT LANGUAGE=javascript>
<!--
function verify(obj){
if(obj.name.value == ""){return false;}
}
//-->
</SCRIPT>
<FORM action="sida1.php" method=POST id=form1 name=form1 onSubmit="return verify(this)">
<INPUT type="text" id=text1 name=name>
<INPUT type="submit" value="Submit" id=submit1 name=submit1>
<?PHP
if(isset($_POST["name"])){
$conn_id=odbc_connect("test","","");
$namn=$_POST["name"];
$sql="insert into forum namn values $namn";
odbc_exec($conn_id,$sql);
odbc_close($conn_id);
}
?>
Not to be rude or anything but if you don't know how to simply submit data to a php page you have a lot to learn and connection to a database isn't the best place to start.. But above is the code you need.. Good luck..