Is there a way to add a variable as part of an item in a drop list? Using the VAR when entering the text did not work. Looking at the element in the Chrome console, I was able to see the <option value> tag, but haven’t much clue how to change it from flat text to a combination of flat text and the variable.
Hopefully it’s something simpler than creating a full blown drop down from scratch, as that’s a bit over my head at least for now.
Edit: Is there a way to target just one drop down when there is more than one on the page? A quick google search suggests that I may need to add a class to the drop down to target it with jquery, but I’m not sure I grasp where/how to add the class in the RunJS or if more language is needed.
I think that will do it, actually – The goal was to have the option read “Text text text <variable value>” In my case, I’m setting a fixed date (assess_date) at the beginning of the course that needs to be added to the end of fixed text. I just fiddled a bit with the sample and think I have the gist enough that I’ll be able to implement.
Once again, thank you! BTW – did you get my email message?
Yeah, you can have as many drop downs as you’d like and specifically target any or all of them. Lectora provides class names and ID’s to to each select element so there’s no need to add any of that. You’ll have to append the target by adding additional specificity. I just replied to your email. I would have missed it in hundreds of other emails if you had not mentioned anything. Thank you. Feel free to email me for more on this if you want. I’ll look out for this one.
With a little more research, I got it! It was just a matter of learning how to add the element id and whether it needed ‘id’ on the end of the element or not. From there, it was just remembering that I needed the # in front of it, and viola: