I am trying to use the validate function to validate the length of the input in richtext field. However, upon validate failure, there is an empty message prompt layer appearing above my custom message prompt. Can anyone advise what am i missing here?
[img]image.JPG[/img]
[img]image2.JPG[/img]
code:
function()
{
if(this.el.dom.value.length > this.maxLength)
{
CQ.Ext.Msg.show({"title":"", "msg":"Maximum characters is 500."}).setIcon(CQ.Ext.Msg.WARNING);
return false;
}
return true;
}
Solved! Go to Solution.
Views
Replies
Total Likes
Take a look at this community article:
http://learncq.blogspot.ca/2012/06/how-to-create-ok-cancel-alert-prompt-in.html
Hope this helps.
Views
Replies
Total Likes
Take a look at this community article:
http://learncq.blogspot.ca/2012/06/how-to-create-ok-cancel-alert-prompt-in.html
Hope this helps.
Views
Replies
Total Likes
Hi, thanks for your reply but it didn't work. I replaced my existing code with just CQ.Ext.Msg.alert('Error', 'Maximum characters is 500.'); because alert prompt is all i need. However, there is this blank alert prompt overlaying my custom alert prompt upon returning false. Even if i removed my code for the alert prompt, the empty alert prompt will still appear. Are there any properties i should be setting to get my error message appear on that empty prompt instead of creating a custom alert prompt? I've tried to set invalidText but it didn't solve the problem.
Thanks in advance.
[img]2015-04-14_9-45-22.jpg[/img]
xtype:richtext
validate:function()
{
var text = this.el.dom.value;
if(this.el.dom.value.length > this.maxLength)
{
CQ.Ext.Msg.alert('Error', 'Maximum characters is 500.');
return false;
}
return true;
}
Views
Replies
Total Likes
Views
Likes
Replies