How to provide validation's existing content fragment models datatypes. | Community
Skip to main content
Level 3
October 16, 2018
Solved

How to provide validation's existing content fragment models datatypes.

  • October 16, 2018
  • 6 replies
  • 4104 views

Hi team,

        How to provide validation's existing content fragment models datatypes.

         How to load clientlibs content fragment model page.

            I created Content Fragment Models,need to do validation's in existing datatypes.

Based existing datatypes created content fragment model page.

Regards

Kotireddy Naru

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 arunpatidar

Hi,

Ok, then you need to add clientlibs with category type of  dam.cfm.authoring.v2

$( document ).ready(function() {

    console.log( "inside CFM - ready!" );

    $("button.button-apply.editor-GlobalBar-item").click(function(){

        alert("clicked");

     })

});

6 replies

arunpatidar
Community Advisor
Community Advisor
October 16, 2018

HI,

You can add validation clientlibs as cq.cfm.admin.models.formbuilder

you need to call that function to validate fields on onclick event of save button.

Arun Patidar
Level 3
October 22, 2018

thanks Arun, providing info.

I am adding my validation's below js files.

/libs/dam/cfm/models/editor/components/formbuilder/clientlibs/js/field-properties.js

/libs/dam/cfm/models/editor/components/formbuilder/clientlibs/js/main.js

/libs/dam/cfm/models/editor/components/formbuilder/clientlibs/js/submit.js

       

those Javascript files not loaded properly in model page.

Thanks

Kotireddy Naru

arunpatidar
Community Advisor
Community Advisor
October 22, 2018

Hi,

Can you check files in network tab or try to put log statement.

working for me.

Saved button event is also working

$( document ).ready(function() {

    console.log( "inside CFM - ready!" );

    $("button.foundation-wizard-control").click(function(){

     alert("save button clicked");

    })

});

Arun Patidar
Level 3
October 22, 2018

thanks Arun,

     I dont need to validation's  Content Fragment Model Editor, need validation's  Content Fragment Model Page level

PFA

         

Thanks

Kotireddy

arunpatidar
Community Advisor
arunpatidarCommunity AdvisorAccepted solution
Community Advisor
October 22, 2018

Hi,

Ok, then you need to add clientlibs with category type of  dam.cfm.authoring.v2

$( document ).ready(function() {

    console.log( "inside CFM - ready!" );

    $("button.button-apply.editor-GlobalBar-item").click(function(){

        alert("clicked");

     })

});

Arun Patidar
Level 3
October 22, 2018

thanks Arun,