This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HTML Label field's "for" attribute problem

 
Mahendran Aiyappan
Ranch Hand
Posts: 102
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,

I have the following HTML content



I wanted the change the label text from javascript method. The labels for attribute is pointing towards the TextBox.
The Problem is I cannot add id attribute for label.(This code is auto generated from some custom tags). How do I can change the label for the corresponding TextBox?

Please give me your comments,
Mahendran
[ March 17, 2008: Message edited by: Mahendran Shanmugam ]
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64192
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Custom tags that don't let you specify basic and essential HTML attributes like id are not something I'd consider using. Do you have control over these tags?

If not, then you'll need to use DOM traversal to locate a reference to the element.

Some libraries like Prototype and jQuery can help you do this easily. In Prototype, the $$() function can help you find element by via CSS attributes. in jQuery you'd do something as simple as:

[ March 17, 2008: Message edited by: Bear Bibeault ]
 
Mahendran Aiyappan
Ranch Hand
Posts: 102
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Bibeault,

I got it.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic