Create / Update Form Variables
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 ” . 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 ? I 'm not sleeping until this is done hahah 😂1I can sleep lol 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 . 💪1As 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🔥1I 'm going to building a list input now like yours , I need about 7 differrent ones hahah be good practice @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 🔥1This 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