Is it possible to call a function from a submit button? I can't get the following to fire:
<html>
<head>
<?php
function func()
{
echo "inside the function";
}
?>
</head>
<body>
<form name="test" action="" method="POST" onSubmit="return func();">
<p>
<input name="numbr" type="text" size="15" maxlength="12">
Enter Number</p>
<p>
<input type="submit">
</p>
</form>
</body>
</html>
Syntax? I've striped this down to a minimum, but would like to use functions to validate input from a form. Using php version 4.1.2 on apache 1.3.23
Thanks - Keith
<html>
<head>
<?php
function func()
{
echo "inside the function";
}
?>
</head>
<body>
<form name="test" action="" method="POST" onSubmit="return func();">
<p>
<input name="numbr" type="text" size="15" maxlength="12">
Enter Number</p>
<p>
<input type="submit">
</p>
</form>
</body>
</html>
Syntax? I've striped this down to a minimum, but would like to use functions to validate input from a form. Using php version 4.1.2 on apache 1.3.23
Thanks - Keith