Hi,
Here's what I've got:
<html>
<head>
<script type="text/javascript">
function foo() {
document.write("foo");
alert("foo");
}
function displayFormElements(var form) {
alert("actually inside the function now");
document.write("displayFormElements called");
var length = form.length;
for(var i = 0; i < length; i++) {
document.write("element " + i + " is " + form.type);
}
}
function CheckForNull() {
var formId=document.getElementById("myForm");
if(formId.elements[0].value == "") {
alert("form may not be null");
}
formId.submit();
}
</script>
</head>
<body>
Form test
<form id="myForm" action="index.html" method="post">
<input type=text name="text1"></input>
<input type=button onClick="CheckForNull()" value="submit" />
<P>
<script language="javascript" type="text/javascript">
foo();
document.write("body script section");
var form = document.getElementById("myForm");
document.write("form contains " + form.length + " elements");
displayFormElements(form);
document.write("after the call to displayFormElements");
</script>
</form>
</body>
</html>
This is my test bed, so to speak. I want to understand what it is I'm
looking at (in the forms) so I wanted to see the data. So, in a
different page I tried to do it and nothing happens in the script tag
in the body section. What am I doing wrong?
Andy