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

Already on GitHub? Sign in to your account

Dinamically removing :required class #4

alexbazan opened this Issue Jul 12, 2010 · 4 comments


None yet
4 participants

Hi, i've got a form in which some elements are required when some conditions are met.

When i add the :required class to the elements and perform Vanadium.init() ; Vanadium.reset() the new required fields are show correctly.

The problem is when i remove via JS the :required class. After init() and reset(), though the field shows the vanadium-valid class, it does not submit the form because somewhere still thinks it is required.


jahrek commented Jul 6, 2011

Same problem. Anyone know how to repair that?

Yeah... only thing you could try to do is copy element and remove :required class.

ABrukish commented Mar 1, 2012

Fixed in my forked version with ABrukish/Vanadium2@9e12ca7

Hi ABrukish, as you said, your fork version solves the problem but adds another one. I have two fields, A & B required in my form. With a checkbox i manage which of them appears visible and 'required' meanwhile the other is hidden and 'unrequired' adding and removing the class ':required' and reseting and initializating the component with Vanadium.reset() and Vanadium.init() methods... The problem is that if i check and uncheck the checkbox X times... when I submit the form, if there are errors, appears the 'error message' as often as checks & unckecks i've made.

Am i doing something wrong?

Thank you in advance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment