[Javascript] Accessing form name

diego nunes dnunes at gmail.com
Mon Nov 21 06:41:14 CST 2005


On 21/11/05, Schalk <schalk at volume4.com> wrote:
> What is the best way to obtain a form name if it is not possible to pass
> it into the script as such: formFunction(this);

    You want the "name", having the instance of the form, or wanna get
the instance, based onde the "name"?

  1) instance named "formInstance":
 alert(formInstance.name);

  2) form named "formanswer":
  alert(document.forms['formanswer']);
     or, better, if you have an unique ID:
  alert(document.getElementById('formanswer'));

  Amplexos.

--
diego nunes



More information about the Javascript mailing list