Hello,
I try to use this javascript to ask the user for confirmation before deleting some data from the database:
<script Language="Javascript">
<!--
function delete(){
var answer=confirm("Do you really want to delete?")
if
(answer)parent.top.location.href="deleteurb.php?code<? $code; ?>&dag=<? $dag; ?>";
}
// -->
</script>
This script doesnt't work because I cannot send the php-variables into the javascript.
I tried to assign javascript variables to the php-variable by putting in the body:
echo " <script language=javascript > \n";
echo "\n jsvalue1 = $code; \n";
echo "\n jsvalue2 = $dag; \n";
echo "\n </script> \n";
but I can't work out how to put this into the javascript to make it work.
Can somebody help me, or does someone have another idea to make this work?
Edith