Modifying forms (f
) and inputs (i
) behavior
#7
Replies: 2 comments 1 reply
-
Beta Was this translation helpful? Give feedback.
-
This will be a great feature, one I would use a lot! I feel option 1 will work because there is often a lot of work done in Webflow on forms:
and so on. So given we're often in Webflow a lot for forms, I think adding a few extra attributes will be fine. There are a lot of settings for forms and form fields already, this is like a new setting but in the form of an attribute. That said we could go for option 2 and just quietly delete the form config info if the form is deleted. Given it's a binary of 'submit' or 'change', if you accidentally deleted a form, even if had 20 fields it would be pretty quick to go in and set the configs per field again. So my vote is for option 2. I think the technical challenges it poses are worth it, as keeping as much logic as possible inside of the Wized configurator is important for scalability as you said @alexiglesias93 . |
Beta Was this translation helpful? Give feedback.
-
Both forms and inputs are defined by adding a
wized="my_name"
HTML Attribute to the<form>
or<input>
elements.By default, Wized generates a
f.my_name
ori.my_name
namespace in the Data Store and populates the values like:f.my_form
is populated when the<form>
emits asubmit
event.i.my_input
is populated when the<input>
emits aninput
event.This behavior is ok as it encourages users to rely more on form submissions, which is usually the best practise when dealing with forms.
But that's not always the case, and we've seen many users wanting to modify the behavior (specially in forms) to be populated on other events like
change
.So, I think we should allow users to modify the event that is used to populate the Data Store namespaces.
I can think of two options to do this:
1. A new
wized-trigger="EVENT_NAME"
HTML AttributeSimple approach where users would simply add an additional HTML Attribute to the form/input element that already has the
wized="my_name"
attribute.For instance, if a user wants a specific form to be updated on
change
instead ofsubmit
, he would add two HTML Attributes to the form:wized="my_name"
attribute to identify the form.wized-trigger="change"
attribute to modify the behavior.Pros:
Cons:
2. A new settings panel for forms and inputs
Allow users to modify this behavior directly from the Data Store, by opening a new settings panel when clicking on an input or form entry:
This approach may be simpler to unexperienced people and has the advantage of preserving the logic inside the Wized Configurator.
Pros:
Cons:
Open for community suggestions!
Beta Was this translation helpful? Give feedback.
All reactions