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

  • SEARCH
  • Home
  • 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 6637481
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T23:19:15+00:00 2026-05-25T23:19:15+00:00

I am working on a large web application project and the previous designer favored

  • 0

I am working on a large web application project and the previous designer favored the use of ids as handles to form fields over name attributes.

I suppose one advantage of this is that the lookup of that field via Javascript is faster through ids.

A big problem I’m now running into, however, is that ids have global scope. I want to refactor a large set of database column names to a more standard naming scheme, which doesn’t include any column name prefix to identify which table the column belongs to. This is going to cause problems in those forms that use ids, since the field ids correspond directly to the column names. Column names which were things like “zon_name” and “pro_name” are now going to both be just “name”. This will cause non-unique ids in the html.

So, after that long preamble, here’s my question…

Before I try to address this scoping issue by changing all the forms to use name attributes instead of ids, are there any other reasons I’m not considering that the original developer may have had for using ids besides the speediness of their lookup?

I know this is a long one so I appreciate anyone who is brave enough to read through and give a good answer. Thanks!

  • 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-25T23:19:15+00:00Added an answer on May 25, 2026 at 11:19 pm

    Name and id do different things and, while there is some overlap, they are not interchangeable for the most important things they do.

    Use name

    • To determine what key will be given to the data when the form is submitted to the server
    • To create radio groups
    • From JS/CSS when you need to reference multiple form controls at once (and when adding a class or using the element type is not more appropriate)

    Use id

    • In the for attribute of the control’s <label>
    • From JS/CSS when you need to reference a specific input

    I suppose one advantage of this is that the lookup of that field via Javascript is faster through ids.

    Not significantly (especially when the name is a unique one).

    It sounds like the original designer hasn’t been following standard conventions and has come up with something highly JavaScript dependant.

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

Sidebar

Related Questions

I am working with a large Java web application from a commercial vendor. I've
I'm working on a large scale performance critical asp web application with a pretty
I'm working on a large website project that makes heavy use of in-page graphing
I've been working on a rather large web application that requires a specific id
I'm working on a large web project based on LAMP stack. I have to
we are working on a large web application with Rails for quite a while
Working on the design of a web-application and since it will be a large
I'm working on a large PHP (Yii framework) web application where users have accounts
I am working on a web application that will make extensive use of AJAX
I'm working on a fairly large web site built in PHP that will potentially

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.