Demo: Using Javascript to access a form when there are multiple forms

Write an Article


Bookmark A Page

The code

function showElements(oForm) {
  str = "Form Elements of form " + oForm.name + ": \n"
  for (i = 0; i < oForm.length; i++)
      str += oForm.elements[i].name + "\n"
  alert(str)
}

Download the code here: javascript-forms-example-1.zip

Back to article:Using JavaScript to access form objects when there are multiple forms

  • Digg
  • del.icio.us
  • Netscape
  • Reddit
  • StumbleUpon
  • Technorati
  • YahooMyWeb

HTML Forms
HTML Form Tutorial
The Form Tag
The Form Submit Button
Form design software

Javascript Form Handling
  Basics
Using getElementById to get the elements in a form
Set value of form element using JavaScript
Get value of form element using JavaScript
Handling multiple forms using JavaScript
JavaScript reset/clear a form
  Advanced
JavaScript Form Validation
Submitting a form using JavaScript
Can JavaScript Email a Form?
Switching the form action field dynamically
JavaScript Button

JavaScript Popup Windows
The window.open method
The window.close method
More ...

 
.   Copyright © 2003-2008 Simfatic Solutions. All rights reserved.