2

I am extracting data from a database that I do not administer. It is a single list, and the important values are:

  • Folder Name
  • Index Integer
  • UID (unique identification) String
  • Filename

I have successfully created a Tree-structured browser, based on a model using <ul> and <li> tags. I had also implemented action listeners on double click, that found the id, and acted accordingly. The identifications were stored, and found as a value-parameter to the individual <li>'s that represented the leaves, or filenames.

However it turns out that the Index numbers are not unique. I expected them to be, even though there were a column for UID's. I tried to set the value to be the UID String. It works in my browser, as a snippet of my generated HTML code shows:

<li role="treeitem" value="1581f20c-0ef9-4c21-a8ab-a407da310cf5" ... >

However, when I retrieve the value, and save it to database, it only gets the numeric value that appears ahead of the first non-numeric character. In this case 1581. I've checked, and come to the conclusion that the value-parameter only accepts numeral values, which really sucks for me...

Are there any other ways to tie a non-displayed UID String to a HTML-list element?

EDIT 2:

I removed my previous edit, due to a realization of what my misunderstanding was. Custom data tags needs the syntax "data-variablename", and when retrieving it, I should ommit the "data-", and just get the variablename.

jumps4fun
  • 3,994
  • 10
  • 50
  • 96
  • WOW, that was a lot of answers, and fast! I was unaware of the option of defining custom data tags in HTML, and I am extremely happy to learn about them. I need to make it compatible for IE8, so I'll read about it's support before setling on a solution, and accepting an answer. – jumps4fun Jun 16 '14 at 13:04