[Javascript] Passing form name to function

Clancy Jones clancyjones at hotmail.com
Tue Sep 2 19:51:19 CDT 2003


Apologies, my whole question is...

Hi all, I have a page with several forms on it.  I want to have a generic
javascript function for submitting them after validation.

eg.
<script language="JavaScript">
function postForm(formName){
document.formName.submit();
}
</script>

Then within a particular form I have a button eg:
<input name="Qsearch" type="button" value="Search" 
onClick="postForm('nameOfThisForm');">

At the moment this is giving me an error:
document.formName is null or not an object.

Can someone help me out with the right syntax for this?

TIA,
Clancy

_________________________________________________________________
Download MSN Messenger @  http://messenger.xtramsn.co.nz   - add your 
friends!




More information about the Javascript mailing list