[Javascript] Accessing form name

diego nunes dnunes at gmail.com
Mon Nov 21 07:43:53 CST 2005


On 21/11/05, Schalk <schalk at volume4.com> wrote:
> But here is my problem:
> I want to create a simple generic reset function for forms within
> Joomla. Now, I do not know beforehand what the form name or id is and
> therefore wanted to determine this with JavaScript.

    getElementsByTagName doesn't return a simple object, but an Array
of the forms in the page. If you wanna get the first form, try
using...
function resetForm() { var tF, tFN;
  tF=document.forms[0]; tFN=tF.name; alert(tFN);
  tF.reset();
}

  btw: my name is "diego nunes". "amplexos" is a portuguese word for
"cheers", or something like that.

--
diego nunes



More information about the Javascript mailing list