Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6810041
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T20:09:30+00:00 2026-05-26T20:09:30+00:00

Consider the following example: <form action=process.php id=myForm> ….. ……. all my form elements </form>

  • 0

Consider the following example:

<form action="process.php" id="myForm">
 ..... 
 ....... all my form elements
</form>

I first accessed my form elements this way:

function verifyForm() {
    var frm_elements = myForm.elements;
    //do something here
}

The above code worked well with the latest versions of Chrome and Internet explorer. However it always failed with Firefox. FF complained about the error : “Could not find the id myForm”

To get this working I replaced myForm.elements with document.getElementById(‘myForm’).elements. It worked fine all the three browsers I tested.

I am just curious to know why did it fail on FF? Did I do anything wrong ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T20:09:31+00:00Added an answer on May 26, 2026 at 8:09 pm

    modify this

    <form action="process.php" id="myForm">
    

    to this

    <form action="process.php" name="myForm">
    

    Because the DOM forms collection works off of name, therefore to access using the form name you need to add the name attribute to the tag. Which will allow the following statements to work.

    document.forms["myform"]
    document.forms.myform
    document.myform
    

    Here is some reference http://www.quirksmode.org/js/forms.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a way to do something like this in c#? Consider the following
What web development frameworks natively support JasperReports? Consider the following form as an example:
Based on: MVC Html.CheckBox and form submit issue Let's consider following example. View: <%
Consider the following simple WPF form, we will try to animate border1's Height: This
Is there any portable way of doing branch prediction hints? Consider the following example:
Consider following example : public class SomeBusinessLayerService : DataService<MyEntityContainer> { [WebInvoke] void DoSomething(string someParam)
Consider the following example. It consists of two header files, declaring two different namespaces:
Consider the following example program: next :: Int -> Int next i | 0
Consider the following example. I have an interface MyInterface, and then two abstract classes
Consider the following example: int size = 10, *kk = new int[size]; for (int

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.