留言板

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

thumbnail
Matthias Thiel,修改在11 年前。

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

New Member 帖子: 2 加入日期: 12-6-1 最近的帖子
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,修改在11 年前。

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

Expert 帖子: 492 加入日期: 12-9-17 最近的帖子
Hi

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


Thanks
azar
thumbnail
Jan Geißler,修改在11 年前。

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

Liferay Master 帖子: 735 加入日期: 11-7-5 最近的帖子
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,修改在10 年前。

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

Liferay Legend 帖子: 1111 加入日期: 11-2-8 最近的帖子
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