Toggle in netteForms.js doesn't work properly, whent there is a type='reset' button, or the form is reset() anyhow. 'reset' event doesn't fire 'change' event on controls, but changes them.
If you check Checkbox in example, TextArea will show, if you then click reset button, Checkbox is unchecked by reset, but TextArea is not toggled properly.
Steps To Reproduce
class TestFormFactory
{
public function create() : Form
{
$form = new Form();
$form->addEmail('email', 'Your email');
$form->addCheckbox('send_me')
->addCondition($form::Equal, true)
->toggle('#frm-testForm-address');
$form->addTextArea('address');
$form->addSubmit("save", "Save");
$form->addButton('cancel', 'Cancel')
->setHtmlAttribute("type", "reset");
return $form;
}
}
Expected Behavior
Form's 'reset' event should be handled for toggling properly.
Possible Solution
Somehow handle 'reset' event on forms and toggle controls which needs it.
Version: netteForms.js 3.3.0
Bug Description
Toggle in netteForms.js doesn't work properly, whent there is a type='reset' button, or the form is reset() anyhow. 'reset' event doesn't fire 'change' event on controls, but changes them. If you check Checkbox in example, TextArea will show, if you then click reset button, Checkbox is unchecked by reset, but TextArea is not toggled properly.
Steps To Reproduce
Expected Behavior
Form's 'reset' event should be handled for toggling properly.
Possible Solution
Somehow handle 'reset' event on forms and toggle controls which needs it.