[Javascript] Passing an object and/or a form reference to a function

dev at qroute.net dev at qroute.net
Fri Jul 9 12:28:44 CDT 2004


How do you pass a form reference to a form validation function so that in
that function body I don't have to spell the whole thing as

function Validate()
{
aValue = window.document.formNameHere.ObjectNameHere.value
}

It'd better If I could do sometihng like

function Val(frmObject)
{
aValue = frmObject.value
}

and/or

function Validate(frm)
{
aValue = frm.frmObject.value
}

On the onSubmit event of a form , or on the onClick event of an object, How
do you call the Validate function so the above idea can be realized ?




More information about the Javascript mailing list