Empty error message prompt | Community
Skip to main content
October 16, 2015
Solved

Empty error message prompt

  • October 16, 2015
  • 2 replies
  • 808 views

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;
}

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by smacdonald2008

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. 

2 replies

smacdonald2008
smacdonald2008Accepted solution
New Participant
October 16, 2015

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. 

October 16, 2015

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;
}