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.

Select Value in MultiSelect dropdown? How to get values?

Home Forums Puzzles Select Value in MultiSelect dropdown? How to get values?

  • This topic has 19 replies, 2 voices, and was last updated 1 month ago by vern.
Viewing 15 posts - 1 through 15 (of 20 total)
  • Author
    Posts
  • #44917
    jezuk
    Customer

    I’ve got some HTML which give me a Dropdown List of Object Codes I can choose (eg 324, 327, 330 etc).

    When my user Selects an Object, how do I get that value?

    I cannot find anything that’d accept that value. I am used to “On Click”, but there isn’t anything relating to a Select (from a List) that I can find in Puzzles.

    If those codes were buttons, i.e. a button for each code, 324, 327, 330 etc, I’d know how to handle that in Puzzles, but this is for a LIST of Codes (around 100 codes long, so I cannot use 100 buttons in my interface!).

    Please can someone help?

    Many thanks.

    • This topic was modified 1 month ago by jezuk.
    #44919
    vern
    Participant

    You just need to use the ‘get prop’ puzzle under the HTML puzzles. Then pick ‘value’. Put the ID name of your HTML element in the element field.
    If your drop down list is made in third party software, check the ‘in parent doc’ option as well.

    #44920
    jezuk
    Customer

    Thanks Vern,

    I’ve tried your suggestion.

    I’m used to “On Event of Click…… do this….”.

    So for your suggestion, I’m trying it with an If, i.e. “If….”Get Prop Value from elem “Profile” = “324”….then do this…..”

    Should that work?

    Or is it some other way?

    Thanks for any further help you can give :)

    #44921
    vern
    Participant

    You just want to get the value from the drop down list when a user selects one of the codes right?

    #44922
    jezuk
    Customer

    Yes, and depending on what code they choose, I want to show that object.

    So what I’d do is Hide everything in the scene, and then just “Show” just that object.

    But first, I need to know what object has been selected.

    #44923
    jezuk
    Customer

    This is my bit of HTML

    <select id=”profile”>
    <option value=”300″ selected>300</option>
    <option value=”324″>324</option>
    <option value=”327″>327</option>
    <option value=”330″>330</option>
    <option value=”335″>335</option>
    <option value=”340″>340</option>
    <option value=”390″>390</option>
    </select>

    #44926
    vern
    Participant

    Ok. So yes, get the value like mentioned before with the ‘get prop’ puzzle, then do ‘if this value = number then show this object’. So you will just have a lot of ‘else if’.

    #44927
    jezuk
    Customer

    Thanks Vern,

    I’m VERY nearly there :)

    I’m learning about Puzzles, and it seems that this process only getting executed once.

    So what’s happening is, is that the If test is getting tested ONLY at the beginning, during the opening of that webpage, so it only ever tests once, sees the first option at the top of that list and that’s it.

    So, if I choose another option off that list, it’s not doing anything.

    It’s almost like I need a Do While loop (and put that If statement inside the Do While loop).

    So, Do While ‘you’re on this page’, test this;
    if the profile value is ….. show this,
    if the profile value is……. show this product,.

    Any ideas how I can just have my If statement tested all the time?

    Many thanks for any help you can give me :) (you’ve helped me a lot and I’m very grateful !).

    #44928
    vern
    Participant

    I’m very glad to help!
    Oh I’m forgetting, you just need to use ‘On Event’ puzzle and pick ‘input’. And then put the ‘get property’ and ‘if’ puzzles in there.

    #44929
    jezuk
    Customer

    I’ve put my If test into an “On Event of” and selected the “mouseleave”……

    Seems to be working :)

    Yay!

    #44930
    jezuk
    Customer

    We typed at the same time Vern, so I’ve changed it to input :)

    Many, many thanks, I’m sooooo chuffed that this is working! (thanks to you!)

    #44931
    vern
    Participant

    You’re very welcome Jezuk! I’m very glad to know it’s working!

    #44932
    jezuk
    Customer

    You’re a star Vern.

    There’s only one ‘big’ problem……

    With a 100 coded products, this will get very unwieldy…..

    To do that, I’ll need a ultra nested If, Then, Else statement (been there before with Excel, I know this won’t work because it’s very, very easy to make a mistake and incredibly difficult to debug, I’ve been there……).

    The solution is that software needs a Select statement in the Logic section of Puzzles.

    If I’ve got a 100 codes, and it can only be any one of these 100 codes, I just want a ‘Select’ statement so that I can test;

    Select (‘Profile’);
    When (“200”) do this….
    When (“203”) do this…..
    etc
    etc
    End Select;
    ….

    I’ve seen these in other packages, like I say, Excel, is very clunky because of this….

    Dang!

    • This reply was modified 1 month ago by jezuk.
    • This reply was modified 1 month ago by jezuk.
    #44936
    vern
    Participant

    Ok. There’s a way more efficient way, it’s just a little more complicated and deeper.
    How are your objects named? (The objects in scene)

    #44939
    vern
    Participant

    Name your scene objects in your modeling software after their corresponding number.

    Then use a ‘find occurrence’ puzzle from Text. Then you can use a ‘for each’ puzzle from Loops to iterate through your list of scene objects to find the correct one.

Viewing 15 posts - 1 through 15 (of 20 total)
  • You must be logged in to reply to this topic.