document.forms
will return a collection of all of the forms within a page.
So
document.forms["myForm"]
will return the form with the name "myForm" from that collection.
And
document.forms["myForm"]["myElement"]
will return an element of that form - a control for example.
So
document.forms["myForm"]["myElement"].value
will return the current data in that control.
I.e. in your case
var x = document.forms["myForm"]["fname"].value;
Gets what the user typed in the control
fname
and stores in in a variable called
x
This is a validation function: it's purpose is to tell the outside world if what the user typed was acceptable. If it isn't, it returns
false
to indicate that.