[Javascript] Accessing form name
Schalk
schalk at volume4.com
Mon Nov 21 07:53:20 CST 2005
diego nunes wrote:
>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.
>
Thanks All. I am sure with all the responses I will be able to put
together something that works. If not, I will be back.
--
Kind Regards
Schalk Neethling
Web Developer.Designer.Programmer.President
Volume4.Business.Solution.Developers
More information about the Javascript
mailing list