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 6324229
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T16:39:54+00:00 2026-05-24T16:39:54+00:00

I am developing an asp.net application and i want to make it compatible with

  • 0

I am developing an asp.net application and i want to make it compatible with all 3 major browsers (Internet Explorer, Firefox, Chrome) at least.

In some pages i need to access the form elements through javascript.
What is the correct way to do this so that it works on all browsers?

I have been doing something like this

document.forms[0].elements["nroErros"].value

to access my “nroErros” hidden field for instance and even though this works on IE, it doesn’t seem to work correctly on Firefox.

So, the question is, what is the correct way to make it work always?

  • 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-24T16:39:55+00:00Added an answer on May 24, 2026 at 4:39 pm

    It works for me: http://jsfiddle.net/6GJsy/

    I believe this is the most cross-browser solution (if you replace elements[elementName] with elements[elementNumber]).

    However, as alternatives you could use:

    document.formname.elementname.value; // simplest IMO
    document.forms[formnumber].elements[elementnumber].value; // most cross-browser solution
    document.forms[formname].elements[elementname].value;
    document.getElementById(elementId).value;
    document.getElementByName(elementName).value; // not supported in some browsers
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing an ASP.NET MVC application and I want to use OpenId. What
I am developing a C#/SQL ASP.NET web application in VS 2008. I want the
I am developing an ASP.NET web application, and now I want to use some
I have an ASP.NET MVC application and I want to make links written in
I´m developing an ASP.NET Web Application and want to use the ASP.NET Routing Engine
I am developing an asp.net web application where i want to call (.exe i.e
I'm developing an ASP.NET MVC application in which I want to encrypt a short
I am developing the ASP.NET MVC 2 application . I want to show the
I'm currently developing an ASP.NET application which uses a MasterPage and I want to
I am developing a multi-tenanted asp.net application and want to know if the following

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.