Meaningless Drivel is fun!*
The moose likes HTML, CSS and JavaScript and the fly likes Link IDs on Page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Link IDs on Page" Watch "Link IDs on Page" New topic
Author

Link IDs on Page

Steve Dyke
Ranch Hand

Joined: Nov 16, 2004
Posts: 1393
Will it cause any problems to have more than one hyperlink with the same ID?
I am using a record sequence index number and assigning this to two link ids. Then this id is used as a parameter for a js function.

One link is used to update record in table row and the second link is used to delete record in table row.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60804
    
  65

All id values on a page must be unique.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Uniqueness is kind of the point of an ID--why would you want them to be the same? If your only purpose is to use the ID as a parameter... why not just use the ID as a parameter, and not an ID?
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Link IDs on Page
 
Similar Threads
Dynamic datatable in jsf
to retrive the last row
Record ID's
Inserting into tables connected by a many-to-many relationship
how to modify the username only once