Create / Update Form Variables

  • /attachments/1317397556426182726/1317397557105918022/IMG_4629.jpg

    Alex

    1 month ago

    I’m wanting to master forms as I am about to build a whole lot of forms for our CRM build.

    Object Variables
    Input / change events

    Who’s got the video or other help thread or advice for me?
    IMG_4629.jpg
  • Tom Ireland

    1 month ago

    There’s a few ways to skin a cat here. You can use single variables for something simple like a signup form or where the form takes only a couple of inputs. Objects are better for larger collections of form data. I’d set any new form value to an empty string to removed “undefined.
  • Tom Ireland

    1 month ago

    I’d be happy to record an example for a profile form I’m working on if it’s helpful? I think @NoCode ProCode also covered objects in forms in his global variables video and there are countless examples in the toddle YT.
  • Alex

    1 month ago

    yes please if you're willing to?

    I'll watch his video in the mean time.

    My forms will have 10-40 values... objects is definitely my route.

    My main issue is just best practice for the change events etc and when to use a variable / direct API data point etc
    👍1
  • Alex

    1 month ago

    Just watched @NoCode ProCode YT on globals. That was perfect, I hadn't seen it that way, makes it way more streamlined.

    So, last question before I build all these forms: He sets hard coded values to showcase the refresh states etc. Would I then just connect my API data to the initial state object, for UPDATE/EDIT forms, so they can have their info prepopulated?

    I assume that as I submit the users forms and POST or PATCH my supabase, the values coming into the UPDATE/EDIT forms will then be up to date info based on their last profile edits from the form submission?

    Make sense?
  • Alex

    1 month ago

    Hmmm, how would I do this intial state using an API?

    Users will only have one 'developer profile' but they may have 3-100 'projects'. How do I set an inital state, if the values are going to be dynamic depending on what item within an array they click?
  • Alex

    1 month ago

    SET global_form_variale on 'click' ? Could wokr
  • /attachments/1317397556426182726/1317427116756832306/Screenshot_2024-12-14_at_10.44.13_PM.png

    Alex

    1 month ago

    On the FORM POPUP BUTTON 'click' event, is this an appropriate way to set the form input values? I'm just trying to learn ha
    Screenshot_2024-12-14_at_10.44.13_PM.png
  • Tom Ireland

    1 month ago

    I just did a wee video but binned it as was rambling a bit. Having another go.
  • Alex

    1 month ago

    thank you
  • I'm not sleeping until this is done hahah
    😂1
  • Alex

    1 month ago

    I figured it out!!! And its passing to my database and feeding back instantly YAY
  • I can sleep lol
  • Tom Ireland

    1 month ago

    Wahooooo!!! Well done, sir. 🙌 Go get some rest. I'll share my updates to my form as well so you have some other approaches to consider. Was just sorting out an issue with country selection, which I nailed. FYI - If you're try to hide a list of countries (or anything else) on blur (clicking an item or clicking outside of the list area), use mousedown instead of click for your item selection because mousedown is fired before on blur. This will ensure the variable value is saved from your selection and you hide your list as well.
    💪1
  • Tom Ireland

    1 month ago

    As promised, here's a video (20 mins) on my form stuff. I added 2 extra short ones to the end to correct a mistake at the end of the first one and another to encourage cleanup using the issues panel. 😉

    https://www.tella.tv/video/form-building-with-alex-39xa
    ❤️2
    🔥1
  • Alex

    29 days ago

    awesome thanks for this Tom!! Great video
  • Alex

    29 days ago

    @Tom Ireland - whats the difference between 'mousedown' and 'click' ?
  • I'm going to building a list input now like yours, I need about 7 differrent ones hahah
  • be good practice
  • /attachments/1317397556426182726/1317780495555100712/Screenshot_2024-12-15_at_10.08.35_PM.png

    Alex

    29 days ago

    Look at me go! I did it @Tom Ireland 🗒️
    Screenshot_2024-12-15_at_10.08.35_PM.png
    🙌2
  • Tom Ireland

    29 days ago

    Mouse down is fired when you first press the button down as opposed to click which is press and release. Mouse down fires before blur so it helps with capturing the value of something before focus is lost.

    Your project form looks ace!
    ❤️1
  • Alex

    29 days ago

    @Tom Ireland https://www.tella.tv/video/building-a-crm-with-conditional-filters-0xe4

    I created some conditional filtering for inputs across the form, pretty cool. Users can select a region, then select a city from a filtered list of only <region_selected> cities.

    Nice UI trick
    🔥1
  • @Alex
    @Tom Ireland https://www.tella.tv/video/building-a-crm-with-conditional-filters-0xe4

    I created some conditional filtering for inputs across the form, pretty cool. Users can select a region, then select a city from a filtered list of only <region_selected> cities.

    Nice UI trick

    Tom Ireland

    28 days ago

    This is looking great, Alex! Nice work, sir. I love how the dropdowns populate based on the previous option selected. 💪

    Resizing a text area is an easy fix for you. See https://www.tella.tv/video/cm4qnn0vv00100al56sp83hf9/view
  • Alex

    28 days ago

    It now filters for Region > City > Suburb

    Now to figure out multi file upload to Supabase
    🙌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.