I want to save it as PHP, look what I wrote:
But it didn't work.PHP Code:<?php
echo "<form onSubmit=\"return disableForm(this);\">";
echo "Name: <input type=text name=person>";
echo "<input type=submit><input type=reset>";
echo "</form>";
?>
<html>
<head>
<SCRIPT LANGUAGE="JavaScript">
function disableForm(theform) {
if (document.all || document.getElementById) {
for (i = 0; i < theform.length; i++) {
var tempobj = theform.elements[i];
if (tempobj.type.toLowerCase() == "submit" || tempobj.type.toLowerCase() == "reset")
tempobj.disabled = true;
}
document.write ($person);
return true;
}
else {
alert("The form has been submitted. But, since you're not using IE 4+ or NS 6, the submit button was not disabled on form submission.");
return false;
</script>
</head>
</html>
It couldn't output $person.
Why please?




Reply With Quote