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.

Is it possible to get an ID based on the Name, or an other attribute ?

Home Forums Puzzles Is it possible to get an ID based on the Name, or an other attribute ?

Tagged: 

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #29363
    kubuz
    Customer

    Hi All,
    I am having trouble. I try to make some logic with a parent html, but the ID’s are dynamic generated, thus change all the time. However, there are a few attibutes that stay the same. In the example below is a text input.
    The id=”ID0ERE” is dynamic, and can’t being used.
    There is also a Fullid, that one is static. Also name is static.

    <input value=”” type=”text” onchange=”ChangeInputValue(this);” maxlength=”50″ id=”ID0ERE” data-econ-is-not-used-in-rules=”false” fullid=”Omschrijving” name=”omschrijving” style=”width: 350px;” data-original-value=”” onkeydown=”KeyDown(this, event);” onkeyup=”onKeyUp(event, ‘,’);” class=” ui-widget-content ui-corner-all eConMandatoryNotFilledField eConTextINPUT”>

    Is there a way to get the ID usinq querySelector? Can i find some documentation or a sample please? Or do I need to take a complete different approach ?

    #29364

    hi,

    you indeed can try the “query selector” puzzle from the HTML category

    Chief 3D Verger | LinkedIn | Twitter

    #29366
    kubuz
    Customer

    Hi Yuri,
    I am glad you are online ;)
    Are you willing to show a small example please? I not sure how to use the query selector.

    #29367
    kubuz
    Customer

    I came a few steps further with this.
    I was able to get the ID trough the console log.
    then i tried to implement it in the puzzles, but it gives an array.
    so I tough, i give it a go.
    But i get an other exeption
    visual_logic.js:330 Uncaught DOMException: Failed to execute ‘querySelector’ on ‘Document’: ‘QUERYSELECTOR,(‘input[Name=”specificaties.bouwvorm”]’).id’ is not a valid selector.

    Puzzle in attachment, I hope someone can help me.

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