When submitting the form, errors can show up in red under each field. The errors are state (Signal) within the input components.
How can I reset the error state (which are signals
[error, setError] = createSignal('')
[error, setError] = createSignal('')
in each input component) to empty (back to initial value
''
''
)?
Note as to why I need this: the form is displayed in a dialog component, when the dialog closes and reopens, the form should reset to initial field values (this is easy as it is a store holding the values externally to the input components, so just need to reset the store to initial values) and not show any errors (this is where I struggle as the error is a signal within each component)