We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.

Get the ID of Select Option

Home Forums Puzzles Get the ID of Select Option

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #32694
    jdock
    Customer

    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.

    Thanks,
    Jon

    • This topic was modified 1 year, 9 months ago by jdock.
    Attachments:
    You must be logged in to view attached files.
    #32699

    Hi,

    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:

    var 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.

    Chief 3D Verger | LinkedIn | Twitter

    #32707
    jdock
    Customer

    Worked perfectly. Thanks!

    #37377
    kreattiva
    Customer

    hi,
    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?

    Thanks

    • This reply was modified 1 year, 5 months ago by kreattiva.
    • This reply was modified 1 year, 5 months ago by kreattiva.
    • This reply was modified 1 year, 5 months ago by kreattiva.
    • This reply was modified 1 year, 5 months ago by kreattiva.
    • This reply was modified 1 year, 5 months ago by kreattiva.
    Attachments:
    You must be logged in to view attached files.
    #37410

    You can change colors using the puzzle Materials /set color. It takes both RGB or CSS color inputs.

    Chief 3D Verger | LinkedIn | Twitter

    #37421
    kreattiva
    Customer

    Hi Yuri,
    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?

    Thanks

    #37457

    looks like the image is not attached? :unsure:

    Chief 3D Verger | LinkedIn | Twitter

    #51964
    dusik geum
    Customer

    I have a question for the masters.
    I’m working on changing the material through the ID value set in the Web Editor (WebFlow), and when I click the button with the ID, something works fine and something doesn’t work. I don’t think there’s a typo, but I don’t know where the problem is.
    Please. (I’m not good at English)

    You can check it out on my homepage
    http://www.widat3d.com
    Configurator -> sofa

    Attachments:
    You must be logged in to view attached files.
Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.