Connecting Tech Pros Worldwide Help | Site Map

Looping through all Form Elements

 
LinkBack Thread Tools Search this Thread
  #1  
Old August 16th, 2006, 07:15 PM
Mel
Guest
 
Posts: n/a
Default Looping through all Form Elements

I need to loop through all form elements such as text, radios, check
boxes and the like and to save their state in a file.

does anyone have JS code to do this ? It can help a bunch

thanks


  #2  
Old August 16th, 2006, 08:05 PM
Georgi Naumov
Guest
 
Posts: n/a
Default Re: Looping through all Form Elements

You can easily iterate the elements colection.
"elements" is a collection, in source order, of all controls in a given
form. input type=image objects are excluded from the collection. For
example:
function handleFormControls(aFormObj){
if(aFormObj.tagName != "FORM")
return;
for(i=0;i<aFormObj.elements.length;i++)
{
var currEl=aFormObj.elements[i];
/*******************************
Work with current control
********************************/
}
}
But you cannot save nothing in file with JavaScript. Only in Internet
Explorer this is possible with AxtiveX control.
Mel написа:
Quote:
I need to loop through all form elements such as text, radios, check
boxes and the like and to save their state in a file.
>
does anyone have JS code to do this ? It can help a bunch

thanks
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.