Hi All,
I want to add AllowBlank for next form:
<script type="text/javascript">CQ.Util.build({xtype: 'panel',border: false,cls: 'entry-fields-wrap',layout: 'form',defaults: { hideLabel: true},items: [ {xtype: 'textfield', defaultValue: 'Entry title', cls: 'title', name: 'title', fieldLabel: 'Entry Title', hideLabel: false, width: '100%' }, {xtype: 'textfield', defaultValue: 'Browser title', cls: 'browserTitle', name: 'browserTitle', fieldLabel: 'Browser Title', hideLabel: false, fieldDescription: 'This title appears in the top bar of the browser window itself', width: '100%' }, {xtype: 'pathfield', rootPath: '/content/', cls: 'titleImage', name: 'titleImage', fieldLabel: 'Title Image', hideLabel: false, width: '100%', allowBlank: false, }, {xtype: 'button', 'text': 'Save Entry','handler': function() {CQ.social.blog.Util.validateEntryForm('${entryForm.id @ context="unsafe"}'); } } ],'renderTo': '${entryForm.id @ context="unsafe"}_fields_wrap' });</script>
But when image field is empty and i click on Save Entry button - Entry will be created - its wrong
Please help - This is the standard library - what can I do to make it work?
Solved! Go to Solution.
Views
Replies
Total Likes
Hi Maria,
Yes, but instead of show, you would do your usual beforesubmit validation:
beforesubmit="function(dialog){ return custom.maria.validation(dialog);}"
Regards,
Peter
Views
Replies
Total Likes
can you post a screenshot please - it will help figure out whats going on.
Views
Replies
Total Likes
I removed several fields. The form is as follows:
When i click on Save Entry button and image field is empty - Entry will be created
Views
Replies
Total Likes
Hi Maria,
Kind of a workaround, that worked for similar task,
You can make your top level entry dialog and perform validation in the listeners area.
If validation is not OK, you can always prevent dialog from submitting and show error message.
Have a look at /libs/dam/components/youtube/channelconfig/channelconfig.jsp for an example of implementing a listener.
Regards,
Peter
Views
Replies
Total Likes
Do you mean something like this?
listeners: { show: function() { var tf = dialog.getField("cq:tags"); snapshot = tf.snapshot(); } }
Views
Replies
Total Likes
Hi Maria,
Yes, but instead of show, you would do your usual beforesubmit validation:
beforesubmit="function(dialog){ return custom.maria.validation(dialog);}"
Regards,
Peter
Views
Replies
Total Likes
Views
Likes
Replies