- 2020-09-10 at 2:46 pm #32694jdockLicensee
This is probably a newbie question. I am adding an HTML element ‘Select’ and building the drop down content ‘Options’. How do I get the ID of the Option returned. I can get the value easily, but not the ID of the option selection. Screen shot of some of the puzzles below.
- This topic was modified 4 months, 1 week ago by jdock.
Attachments:You must be logged in to view attached files.2020-09-10 at 3:32 pm #32699
You might employ the new exec script puzzle that is available in version 3.4 preview.
So you can put the following into this puzzle:12var mySelect = window.parent.document.getElementById("Capacity");VARS['myVar'] = mySelect.options[mySelect.selectedIndex].id;
In puzzles, create a variable with the name myVar, to which the ID of the selected Option will be saved.2020-09-10 at 6:10 pm #32707jdockLicensee
Worked perfectly. Thanks!2021-01-14 at 9:17 am #37377kreattivaLicensee
i’m trying to do it but i can’t.
I have to get the ‘Nero’ entry working with which you can change the color of the text.
I tried to recreate the recommended code, but I don’t understand where I have to put my options, in this case the ‘Nero’ id.
Where am I wrong?
- This reply was modified 4 days, 8 hours ago by kreattiva.
Attachments:You must be logged in to view attached files.2021-01-15 at 11:02 am #374102021-01-15 at 3:16 pm #37421kreattivaLicensee
the text editor works.
The problem is that the elements in the drop-down box (example: black, white, red…) do not work.
The other items outside the box work perfectly.
Fonts work thanks to Verge3D puzzles.
I assigned an ID to each of those elements (example: black, white, red…) but I can’t get Verge3D to understand it.
I tried to do what you recommended above but it didn’t work.
I attached the photo of the problem in the previous message.
How can I fix it?
Thanks2021-01-18 at 9:40 am #37457
- You must be logged in to reply to this topic.