Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Toggle function #25

Open
cafesk8 opened this issue May 20, 2019 · 1 comment
Open

Toggle function #25

cafesk8 opened this issue May 20, 2019 · 1 comment

Comments

@cafesk8
Copy link

cafesk8 commented May 20, 2019

When using this form render the toggle function doesn't work anymore. How can I achieve the toggle function?

Example:

$form->addCheckbox('accommodation','Enable accomodation?')
	->setDefaultValue(false)
	->addCondition($form::EQUAL, true)
		->toggle('accommodation_price');

$form->addText('accommodation_price','Accommodation price / night')
	->setOption('id', 'accommodation_price')
	->addConditionOn($form['accommodation'], Form::EQUAL, true)
		->setRequired('The accommodation price is required.')

The accommodation_price input is always visible, no matter if the accommodation checkbox is checked or not.

@PavelJurasek
Copy link
Contributor

Wrap the accommodation_price input pair in a div (or any other tag) with html id accommodation_price.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants