Hi Team,
I am trying to show the custom message on dialog field if not valid using validate property.
validate string (type) function(){ var Value = this.getValue(); if(Value.length > 0){ this.markInvalid('Please enter correct value'); return false; } }
Still I am getting the default error message ."Verify the values of the marked field"
PFA
Thanks a lot in advance
Views
Replies
Total Likes
Try the below one for custom error message.
CQ.Ext.Msg.show({
title:'Save Changes?',
msg: 'You are closing a tab that has unsaved changes. Would you like to save your changes?',
icon: CQ.Ext.MessageBox.ERROR,
buttons: CQ.Ext.Msg.ERROR,
});
Thanks
Tuhin
Views
Replies
Total Likes
Hi ,
I tried this approach as well its not working, still I see the default message.
I think the problem in this dialog is included as cq:include in another dialog which might not allowing it ?
Thank you
Views
Replies
Total Likes
this below piece code works for me, last one had a typo, if you have copied and pasted that exactly then it might be of some problem.
if(Value.length > 0){
CQ.Ext.Msg.show({
title: 'markInvalid',
msg: 'The scheduled end date must be set after the scheduled start date.',
icon: CQ.Ext.MessageBox.ERROR,
buttons: CQ.Ext.Msg.OK
});
return false;
}
Views
Replies
Total Likes
Thank you
I tried the above approach still its not working .
Thanks
Views
Replies
Total Likes
I think that might be because your listener code is not executing properly.
Please place one alert message inside the if statement to see if it is executing at all.
if the alert message from the if statement is not coming try using the below code and see.
function(dialog){
var value = this.findById("jcr:title"); /** replace "jcr:title" with the field name on which you want to validate **/
if(value.length > 0){
CQ.Ext.Msg.show({
title: 'markInvalid',
msg: 'The scheduled end date must be set after the scheduled start date.',
icon: CQ.Ext.MessageBox.ERROR,
buttons: CQ.Ext.Msg.OK
});
return false;
}
}
Thanks
Tuhin
Views
Replies
Total Likes
Alert message is working but custom message through message box is not working.
Thanks
Views
Replies
Total Likes
Hi Sumit,
I am not sure why the custom message is not getting shown in your application. Please view the below community article where a similar kind of implementation is there which is same as above.
https://helpx.adobe.com/experience-manager/using/tips-tricks.html
Thanks
Tuhin
Views
Replies
Total Likes
which xtype do you want to validate in the dialog ?
Views
Replies
Total Likes
datetime xtype
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies