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.

Set prop “value” does not work

Home Forums Bug Reports and Feature Requests Set prop “value” does not work

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #56267
    NaxosCG
    Customer

    Hello,
    To create some menus from puzzles, i need to set prop “value” to html host page, but it does not work…

    Please see attached screenshots.

    img 1 : value-not-working-1.png : you can see that i put “src”, “width”, “height”, “classname”, and a “value” to an “img” html element…
    (i’ve tried with variable, with “create text with variable”, but also with some manually entered text)

    img 2 : value-not-working-2.png : on the right what i would need (so with “value” param; on the left the generated code i get in the console : see ? src, width and so on are written, but not “value”.

    Any idea ? is this a bug ?

    Best regards.

    Attachments:
    You must be logged in to view attached files.

    "1+1=3... for large values of 1"

    #56270
    kdv
    Participant

    that’s because value is not one of <img> attributes
    https://www.w3schools.com/tags/tag_img.asp

    value is an attribute of <input>
    https://www.w3schools.com/tags/tag_input.asp

    P.S. You cannot set attributes href or download to <img> too, for example.

    Puzzles and JS coding. Fast and expensive.

    If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.

    #56271
    NaxosCG
    Customer

    that’s because value is not one of attributes
    https://www.w3schools.com/tags/tag_img.asp

    value is an attribute of <input>
    https://www.w3schools.com/tags/tag_input.asp

    Ok, but it is also available for img, as my menu i always use with my verge3D tests is using that way, it’s some js+html tabbed menus.
    Anyway, i need to create the prop, and it does not, can you make it work in anyway ?

    In this menu system, the value is set to tell that this submenu “belongs” to that tab…

    Best regards.

    "1+1=3... for large values of 1"

    #56272
    NaxosCG
    Customer

    You can see one example in this test :
    https://v3d.net/b6i

    See how the value is set and used.

    "1+1=3... for large values of 1"

    #56273
    kdv
    Participant

    So what? You can write any attribute manually. But if an element doesn’t have this attribute you can’t set it. <img> has a lot of attributes but value is not one of them. The set prop puzzle sets value for an existing attribute. No attribute – no value set.

    p.s. you can use the title attribute to filter <img> tags.

    Puzzles and JS coding. Fast and expensive.

    If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.

    #56277
    NaxosCG
    Customer

    I get your point, kdv77kdv, and as you helped me before and as i’m not a code specialist, i’d rather trust you.

    Just the code i’ve used (from a free website – i guess jQuery) for years now just uses “value” inside an “img” block.

    Remember, i’m a 3D artist, clearly not a coder, but here i’m stuck because of that.
    Maybe i could find another free html/js tabbed menu that accepts jpg as submenu content ?
    Maybe you know one that i could use ?

    regards.

    "1+1=3... for large values of 1"

    #56286
    kdv
    Participant

    you use jquery-ui.js for the tabbed menu, right? this value attribute plays no role in the tabbed menu creating at all.
    https://v3d.net/bcl

    In this menu system, the value is set to tell that this submenu “belongs” to that tab…

    The value attribute tells nothing. It’s just not asked. It’s an unused attribute.

    You have severals <div> elements with the class name TabbedPanelsContent. Each of them has id. And this id determines what tab this element belongs to.

    The only place where the value attribute is called is the script in the begining of the html document

    <script>$(document).ready(function() {$("img.min").click(function(){$("img.viewer#" + $(this).attr("value")).attr("src", $(this).attr("title"));});$("#TabbedPanels1").tabs();});</script>

    This script creates tabs (you need them) and registers the event listeners ‘click’ for every <img> element (you don’t need them). So you can reduce this script to creating tabs only.

    <script>$(document).ready(function() {$("#TabbedPanels1").tabs();});</script>

    Puzzles and JS coding. Fast and expensive.

    If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.

    #56541
    NaxosCG
    Customer

    Hello,
    Can you add the “tabindex” property in the “set prop” puzzle list for html, please ?
    I need it for some stuff. It may be the reason why my puzzles don’t create nice menu, as espected.
    Thank you.

    "1+1=3... for large values of 1"

    #56542
    kdv
    Participant

    document.getElementById('some_id').tabIndex = 0;

    Puzzles and JS coding. Fast and expensive.

    If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.

    #56543
    NaxosCG
    Customer

    document.getElementById('some_id').tabIndex = 0;

    I’ll give a try, thank you.

    "1+1=3... for large values of 1"

    #56545
    NaxosCG
    Customer

    mmm, still not ok…

    "1+1=3... for large values of 1"

    #56560
    kdv
    Participant

    What’s wrong? Can’t swith between tabs with TAB button? It should work with no problems…
    https://v3d.net/bcl

    Puzzles and JS coding. Fast and expensive.

    If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.

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