I'm trying to get the hang of functions using PHP and JavaScript but I have a problem I can't fix. My HTML for a form starts with:
<html>
<head>
<? include("banner.html"
include("navigate.html"
include("custtitle.html"
require ("function.php"
?>
</head>
The function looks like this:
function funDelCust()
<script LANGUAGE="JavaScript">
if (confirm("Are you Sure") {
alert("OK"
WRITE("THIS IS A TEST"
} else {
alert("NOT OK"
}
</SCRIPT>
(I'm just trying to get the functionality down for now. I'll add the real code later.)
The problem is that the confirm window pops up as soon as the form is displayed (the fields are not populated either). It also prints "function funDelCust()" under my headings on the form I had intended to execute the function when the 'Delete' key was pressed but the program doesn't wait. Once I press 'OK' in the window the fields are populated and the form works ok except the delete key does not execute the function.
All help is greatly appreciated.
Scott
<html>
<head>
<? include("banner.html"
include("navigate.html"
include("custtitle.html"
require ("function.php"
?>
</head>
The function looks like this:
function funDelCust()
<script LANGUAGE="JavaScript">
if (confirm("Are you Sure") {
alert("OK"
WRITE("THIS IS A TEST"
} else {
alert("NOT OK"
}
</SCRIPT>
(I'm just trying to get the functionality down for now. I'll add the real code later.)
The problem is that the confirm window pops up as soon as the form is displayed (the fields are not populated either). It also prints "function funDelCust()" under my headings on the form I had intended to execute the function when the 'Delete' key was pressed but the program doesn't wait. Once I press 'OK' in the window the fields are populated and the form works ok except the delete key does not execute the function.
All help is greatly appreciated.
Scott