PricingBlog

show alertbox

  • chriss1639-1289056475842347008

    Chris

    1 year ago

    I want to show an alertbox on successful email submission.

    1) I created a variable show-alertbox and set it to true
    2) I use this variable to hide the div that holds the alertbox properties using the "not" formula.
    3) "on success" of the event form submit I set the variable show-alertbox back to true.

    Why is this not working? Why does the alert box not appear (the email is indeed sent successfully to the backend).
  • Tod-1289056478476636231

    Tod

    1 year ago

    Great energy @Chris! Your continuous contribution to the toddle Community just made you advance to Community Level 1!
  • needtheanswers-1289108815362523210

    needtheanswers

    1 year ago

    do you mind sharing your project link or screenshots?
  • chriss1639-1289233545470021766

    Chris

    1 year ago

    This is a version of the Surfboard tutorial for Fastgen (in the docs)

    https://sunsetboards_fastgen.toddle.site/

    Simple landing page with 2 API calls
    POST email submission
    GET product catalogue

    On submit I want
  • chriss1639-1289234902901854299

    Chris

    1 year ago

    On submit I want an alertbox appear. Gave the div a class "alert-box", but there is no way in the event manager to address a class directly, so I tried via a variable, but that doesn't seem to work either.
    Other issues I face:
    - The product images are pulled from fastgen, but do not diplay because the url of the public bucket is not working (a fastgen issue)
    - Site is not yet responsive. I set a max width of 1920px, but I get all that empty space to the right
  • The email submission works
  • max.kayr-1289237296931016714

    Max

    1 year ago

    Hey @Chris! The show-alertbox variable is set to true on default and you negate it on your "show" formula, so that it is not displayed by default. Then after the waitlist success, you set it to true. So you did not change it. That is why it won't be displayed. You can set the show-alertbox variable to false by default and loose the "not" in the "show" condition. After success you set it to true. Then it should work 🙂
  • max.kayr-1289238102283649044

    Max

    1 year ago

    The max-width only limits the outer div to 1920px, but you cannot limit the browser window. So your page is at the left side with some space to the right on larger displays. What you could do is make the outer div width 100%, center content and the next div max-width to 1920px. Then the content will have a max width of 1920px and be centered.
  • Hope this helps 🙂
  • max.kayr-1289238831639302186

    Max

    1 year ago

    Ah, you can also bind the class to the variable. There is a small fx box next to the class. If the condition in there is true, the class is applied. Otherwise it is not
  • chriss1639-1289415818139926631

    Chris

    1 year ago

    @Max Thanks. The issue was actually with Fastgen. Had to redo the database with Xano and it now works. Took me ages to find out. Which raises the question of troubleshotting in Toddle. How would I know that an API that "successfully" sends emails to to a database would not trigger the "on success" event?

    Anyway, here is the improved version
    https://sunsetboards_fastgen.toddle.site/
  • max.kayr-1289429512915783736

    Max

    1 year ago

    Hi @Chris! I see that now your "show-alertbox" is set to false by default 😉 So this is fine. Regarding troubleshooting API responses: You can see the result in the API panel (toggle auto-fetch to see the result) and you can use the "Log to console" node to log responses to your browser console.
    The "On success" workflow triggers when your call returns a status code in the 200 range. If it returns a status code in the 400 or 500 range, it will throw an error.