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