contributte / live-form-validation

:no_entry: Nice client-side live form validation for Nette Forms.
https://contributte.org/packages/contributte/live-form-validation.html
BSD 3-Clause "New" or "Revised" License
59 stars 24 forks source link

toggle not work #33

Open attreid opened 7 years ago

attreid commented 7 years ago
$form->addCheckbox('check')
    ->addCondition($form::EQUAL, true)
    ->toggle('checked');
$form->addText('input')
    ->setOption('id', 'checked');

This code work with original netteForms.js

attreid commented 7 years ago

Update: its not problem with toggle, but when I use jquery 3, sometimes live validation work and sometimes not.

FTCP commented 3 years ago

Update: its not problem with toggle, but when I use jquery 3, sometimes live validation work and sometimes not.

I am using jquery 1.12.4 and toggle still doesn't work

for example multi toggle doesn't work at all, only one toggle will be showns / hidden.

->addCondition($form::EQUAL, TRUE) ->toggle('frm_confirm_yes',FALSE) ->toggle('frm_u_businessName') ->toggle('frm_u_firstName') ->toggle('frm_u_lastName');

only 'frm_confirm_yes' hides and the rest stay hidden.

EDIT: problem occurs when you use one or more toggles to hide and others to show or vice versa