Checkboxes not working for me

jodie
jodie

Hello, I don't have any published examples, but the out of the box checkbox functionality isn't working for me as described here - https://help.obsidianportal.com/article/173-creating-a-dynamic-character-sheet-template-dst

When I check the checkbox in edit, it does not remain checked on the resulting read page, and going back to edit it is still unchecked.

I do add the 'csx_pathfinder_common.js' library, but I'm not interfering with the checkboxes in my own javascript :/

Comments

  • thaen
    thaen
    Posts: 943

    Thanks for the heads up!  I'll do some research and report back.

    Obsidian Portal Developer

  • thaen
    thaen
    Posts: 943

    @jodie, I created a test DST with only the checkbox html.  When I tested that, the checkbox maintained the check on Save and Edit, so I'm guessing there is some conflict between some other part of the HTML/JavaScript that you're using and the checkbox.

    So I can debug the specific situation where it's not working, can you send me an OP message with the HTML and JavaScript code where the checkbox isn't working with the checkbox HTML in place?  (The Community Forum software has bit of difficulty formatting/displaying HTML ... which is why I'm asking for an OP message instead of a post here.)

     

    Obsidian Portal Developer

  • twiggyleaf
    twiggyleaf
    Posts: 1,903

    smiley

    "I met a traveller from an antique land....."

    CotM May 2016: Mysteria: set in Wolfgang Baur’s MIDGARD.

    Previous CotM Aug 2012: Shimring: High Level Multiplanar Campaign

    Inner Council Member

  • jodie
    jodie
    Posts: 82

    Thank you Thaen, it's the commented snippet with the 'isForceSensitive' class on here - https://www.obsidianportal.com/dynamic_sheet_templates/434

    Thank you for going to all the trouble of replicating, sorry for wasting your time. It must be something in the script I'm importing. I'll figure it out when I have a minute.

  • thaen
    thaen
    Posts: 943

    Not a waste of time at all.  In this case, it looks like there's a bug in the csx_edit function that grabs ANY field with a "dsf" and treats it as a textbox ... even "dsf checkbox".  I'll contact chainsaw and see if he can add a "not checkbox" to that or something.  In the meantime, if you want yours to work, you could do something like this:


    function starwarsd6simple_setup(context){
    $('.dsf.checkbox').addClass('ignore-dsf').removeClass('dsf');
    csx_edit(csx_opts.defaultContext);
    $('.ignore-dsf.checkbox').addClass('dsf').removeClass('ignore-dsf');
    }

    Basically, hide the "dsf checkbox" from the "csx_edit" while "csx_edit" is running by disguising the checkbox temporarily as a "ignore-dsf checkbox".  : )

    Obsidian Portal Developer

  • thaen
    thaen
    Posts: 943

    @jodie, Chainsaw fixed up the csx_edit (and other code too), so the standard checkboxes should work now (even without the work around code above).  Let me know if you're still seeing any issues.

    Obsidian Portal Developer

  • jodie
    jodie
    Posts: 82

    <3 You're awesome, thank you ^_^

Sign In or Register to comment.

July 2022
Signs and Portends

Read the feature post on the blog
Return to Obsidian Portal

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Discussions