Willkommen, Gast
Benutzername: Passwort: Angemeldet bleiben:

THEMA: Collision between dynamically generated input element IDs?

Collision between dynamically generated input element IDs? 4 Monate 3 Wochen her #107078

  • mmatos
  • mmatoss Avatar
  • OFFLINE
  • Fresh Lemon
  • Beiträge: 1
  • Karma: 0
Hi guys. It's kind of a weird issue so I'll try to summarize as best as I can. A developer on my team ran in to a very strange issue where he was having trouble updating the value of a text element. After looking at it for a few, we discovered that there's a scenario where the dynamically generated element IDs can collide.

Background/Assumptions:

Scenario 0: When LS creates an input element, it does so in the following format.
Element ID = #answer[surveyID]X[GroupID]X[QuestionNumber]

Scenario 1: Furthermore, when this input element is of type radio button list, the answer elements are created as:
Element ID = #answer[surveyID]X[GroupID]X[QuestionNumber][AnswerNumber]

Scenario 2: When this input element is in a group, the answer elements are created as:
Element ID = #answer[surveyID]X[GroupID]X[QuestionNumber][QuestionInGroup]

So, assuming we have a radio button list question, the IDs would be something like:

#answer999999X1X51 for the first answer radio button id
#answer999999X1X52 for the second answer radio button id
and so on.

Now...on the same page we have a group of questions that has repeated 5 times. You might see where I'm going with this. We have a page with Scenario 1 and Scenario 2 happening together.

When each of the answer elements are generated in this 5th group, the IDs for the input elements are generated as such:

#answer999999X1X51
#answer999999X1X52
and so on.

So basically now the element ID has collided due to this situation. I was able to get my developer around this by specifying a more specific element id (including a class and input type in his selector) but what I don't know yet is whether this affects the collection of responses. I'm new to LS so I just haven't gotten there yet, but I wanted to post about this in case it was a bug that needed to be addressed or someone had some advice/thoughts on how to best avoid this situation.

Your thoughts appreciated!
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Collision between dynamically generated input element IDs? 4 Monate 3 Wochen her #107086

  • DenisChenu
  • DenisChenus Avatar
  • OFFLINE
  • Moderator Lime
  • Beiträge: 6272
  • Dank erhalten: 800
  • Karma: 240
Hi,

I allways use alphabetic character for answer code and sub question code , then: no collision.

But i think we have a system to fix numbering when activate a survey, did you test to activate and deactivate and see if the question id was updated ?

Denis
PS: you can put a bug report, but i think it's a 'wont fix'
Der Administrator hat öffentliche Schreibrechte deaktiviert.
Moderatoren: ITEd
Ladezeit der Seite: 0.147 Sekunden
Donation Image