• Post Reply Bookmark Topic Watch Topic
  • New Topic

Is it a bad idea to store info in custom form element attributes  RSS feed

 
Christopher Whu
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have been doing alot of ajax work lately and i have been experimenting with storing data in custom attributes w/in a form element...



i have been pulling this data with jquery .attr()... Its so easy it feels wrong... Is this a bad way of doing things?
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Using scriptlets is the bad part. Update your JSP knowledge to modern standards.

If you are going to use custom attributes (and yes, I do), you should follow HTML5 conventions (even if not using HTML5 yet) and name them using the data- prefix.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!