Form elements in Javascript

We are working on a new project and we needed to create the array of form elements in Javascript. After googling for some time we found out that we can access all the form elements in document.formName.elements

Following code loops through the form and creates an associative array of form elements:

function getFormElements()
{
frmElmts = new Array();
for(i=0; i

Advertisements

2 thoughts on “Form elements in Javascript

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s