PricingDocsAcademy
Bluesky ...
Wed, Dec 11, 10:10 PM

How do you stop a button from executing?

  • mesmoiron

    1 month ago

    Hi, I have a variable and if it is empty/reset than some other button should not do the click event. I want to prevent empty items added to the to do list. I have tried the click event or the add item workflow, but in the formula the variable keeps disappearing if I set the first value as an empty string. Depending on my test run, the formula keeps changing, while I try to set the desired logic.
  • Armand

    1 month ago

    The first thing that comes to mind is to use a Switch. But perhaps you can share a video or a few screenshots to show what you are trying to do as it's hard to get a good picture without visual context.
  • Max

    1 month ago

    Can you share the project link? Than we could have a look
  • mesmoiron

    1 month ago

    Yes, I will make some pictures
  • Tod

    1 month ago

    Great energy @mesmoiron! Your continuous contribution to the toddle Community just made you advance to Community Level 6!
  • Lucas G

    1 month ago

    You can conditionally disable the button
  • If empty
  • @Lucas G
    If empty

    mesmoiron

    1 month ago

    Can you tell how to do it? if it is empty then :
    do nothing
    stop
    block
    What is the wording or function to call? Or is it the place. I tried putting it in the else part, but it still makes an empty item. Unless I have to remove that item. But that doesn't sound as the correct way to do it.
  • Tom Ireland

    1 month ago

    There is an HTML attribute called disabled, which allows you to disable a button. You can set a formula on this attribute to check if the variable is empty. If true, set disabled to true; else set it to false.

    See https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/disabled
  • /attachments/1298587672834478110/1299624574408720417/disabled.mp4

    Armand

    1 month ago

    I had the same answer as Tom πŸ™‚
    πŸ’―1
    πŸ”₯1
    πŸ’ͺ1
  • Tom Ireland

    1 month ago

    ☝️ This right here. Nice one, Armand! πŸ’ͺ
    πŸ‘1

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.