Retrieve checkbox value

  • jubilant_courgette_93644-1316830344686735391

    Dov

    4 months ago

    I am having difficulty getting the true/false from a checkbox.

    I have setup the checkbox by adding an attribute called checked which is bound to a bool in an array. Then on input (or change) event I want to get the value. But when I go into the editor all I can see is event-target-value. How do I get the checked state?
    1316830345005633637-image.png
    1316830345366212740-image.png
  • lucasg-1316830850989428898

    Lucas G

    4 months ago

    On input just set the variable to the reverse of its current state
  • variable -> not node
  • jubilant_courgette_93644-1316831181400051764

    Dov

    4 months ago

    Ok.
  • jubilant_courgette_93644-1316833286370230302

    Dov

    4 months ago

    Another quick question - is this the correct way to bind the variable? The data is set to true, but when loading it seems to flash true then goes false.
    1316833286097473636-image.png
  • lucasg-1316833562510757918

    Lucas G

    4 months ago

    You could try adding a Default to node
  • Default to false
  • jubilant_courgette_93644-1316833866903846954

    Dov

    4 months ago

    Sorry, what does that mean (I am not sure where to do that)?
  • lucasg-1316833920381354005

    Lucas G

    4 months ago

    There is a node called default to
  • It is a very useful node. I personally use it often
  • jubilant_courgette_93644-1316834593764016128

    Dov

    4 months ago

    Is this what you mean? I am not sure what a node is ๐Ÿ˜ฅ
  • jubilant_courgette_93644-1316834928666611712

    Dov

    4 months ago

    1316834928452964412-image.png
  • lucasg-1316835013064396875

    Lucas G

    4 months ago

    Ah no. I meant a formula node
  • lucasg-1316835227955499079

    Lucas G

    4 months ago

    In that formula, click the plus icon and add a Default to node in between
  • jubilant_courgette_93644-1316835266761199738

    Dov

    4 months ago

    ok
  • Tod-1316835267872686204

    Tod

    4 months ago

    Great energy @Dov! Your continuous contribution to the toddle Community just made you advance to Community Level 6!
    ๐Ÿ‘1
  • jubilant_courgette_93644-1316835964294795295

    Dov

    4 months ago

    I have done that. Is it correct that the value is now null?
    1316835964315898006-image.png
  • lucasg-1316838184197292186

    Lucas G

    4 months ago

    Yeah refresh the page and test it out
  • jubilant_courgette_93644-1316838447528415293

    Dov

    4 months ago

    ok
  • jubilant_courgette_93644-1316940608564367402

    Dov

    4 months ago

    Thanks. I got it working.

Stop scrolling. Start building.

toddle is a visual web app builder that rivals custom code โ€” but accessible to your entire team!

Try toddle โ€” it's free!

ยฉ Copyright 2024 toddle. All rights reserved.