留言板
aui validation ?
HI,
In aui input field user cant able to type more than six characters?How to give that kind of fixed numbers of caharacters in aui....
Thanks in advance..
In aui input field user cant able to type more than six characters?How to give that kind of fixed numbers of caharacters in aui....
Thanks in advance..
Hi Angu,
I have dedicated on section exclusively on AUI validation in my FREE eBook on Liferay Portlet Development. You can download a free copy and refer to chapter no. 4 to know about this in details. Please revert back to me if you still have questions.
Yours truly,
Ahamed Hasan
Author, Liferay Portlet Cookbook
I have dedicated on section exclusively on AUI validation in my FREE eBook on Liferay Portlet Development. You can download a free copy and refer to chapter no. 4 to know about this in details. Please revert back to me if you still have questions.
Yours truly,
Ahamed Hasan
Author, Liferay Portlet Cookbook
Hi Angu,
You can try this -
<aui:input name="name" type="text" onBlur="validateName()"/>
<aui:script>
function validateName() {
AUI().use(function(A) {
var name = A.one("#<portlet:namespace/>name").val();
if(name.length > 6) {
alert("Length Exceeded");
}
});
}
</aui:script>
Regards,
Atin Agarwal
You can try this -
<aui:input name="name" type="text" onBlur="validateName()"/>
<aui:script>
function validateName() {
AUI().use(function(A) {
var name = A.one("#<portlet:namespace/>name").val();
if(name.length > 6) {
alert("Length Exceeded");
}
});
}
</aui:script>
Regards,
Atin Agarwal
Hi Atin Agarwal,
My aui input field is not text field That is Pincode field only digits can only enter...
My aui input field is not text field That is Pincode field only digits can only enter...
Use this -
<aui:input name="name" type="text" onBlur="validateName()">
</aui:input>
<aui:input name="name" type="text" onBlur="validateName()">
<aui:validator name="digits" />
</aui:input>
For me user can't able to type more than Six characters (in numbers) this my requirement.
Yes i understand that.
First validation i.e. <aui:validator name="digits" /> will take care of the fact that user can only enter digits.
Second custom validation(through script) will take care of the fact that user can cannot enter more than 6 characters.
Use this and let me know in case of any issues.
Regards,
Atin Agarwal
First validation i.e. <aui:validator name="digits" /> will take care of the fact that user can only enter digits.
Second custom validation(through script) will take care of the fact that user can cannot enter more than 6 characters.
Use this and let me know in case of any issues.
Regards,
Atin Agarwal