Foros de discusión

Is it possible to disable an aui:validator (required)?

thumbnail
Matthias Thiel, modificado hace 11 años.

Is it possible to disable an aui:validator (required)?

New Member Mensajes: 2 Fecha de incorporación: 1/06/12 Mensajes recientes
Hi,

is it possible to disable an aui:validator (required) by a javascript function?

E.g. I put an input like

				<aui:input label="bank" name="bank" value="">
					<aui:validator name="required" />
				</aui:input>


When disabling the input-field within a onChange-function, it is disabled, but on form submit the validator still forces to enter a value.

Regards,

Matthias
thumbnail
mohammad azaruddin, modificado hace 11 años.

RE: Is it possible to disable an aui:validator (required)?

Expert Mensajes: 492 Fecha de incorporación: 17/09/12 Mensajes recientes
Hi

Remove this line
<aui:validator name="required" />


Thanks
azar
thumbnail
Jan Geißler, modificado hace 11 años.

RE: Is it possible to disable an aui:validator (required)?

Liferay Master Mensajes: 735 Fecha de incorporación: 5/07/11 Mensajes recientes
If i remeber correctly this tag will add some css classes to your input field. If you remove those, it should work. Not quite shure about it though...

EDIT:
Ok, just tried it, but this doesn't work. I think you need to dig through the JavaScript code to detach the Validator Event handler somehow.

EDIT 2:
Aaaaaahhhhhhhhhhhhhh. Just now I have seen this thread is as dead as a zombie..... Sorry for participating in this Grave Digging....
thumbnail
meera prince, modificado hace 10 años.

RE: Is it possible to disable an aui:validator (required)?

Liferay Legend Mensajes: 1111 Fecha de incorporación: 8/02/11 Mensajes recientes
Hi

Instead of using validator tag use AUI validation java script so that we can control.

or do like this

once page render in browser see the html code for that tag and find out some css property which specify the required. in the on change change that css class name so that we can avoid that validation..

The following is different ways of validation liferay please have look it may help you...

http://www.liferaysavvy.com/2014/01/form-validation-in-liferay.html


Regards,
Meera Prince