Page properties dialog validation on 6.4 | Community
Skip to main content
Level 9
December 21, 2021
Solved

Page properties dialog validation on 6.4

  • December 21, 2021
  • 1 reply
  • 817 views

All, 

 

I want to validate if a proeprty value exists prior to saving page properties.
Tried below but although it submits the form just stays in its place showing the save and cancel buttons while i want it to take me out of the screen.

Tried  $propertiesForm.submit();

 

Kindly let me know


(function($document, $) {
"use strict";

//form id defined in /libs/wcm/core/content/sites/properties/jcr:content/body/content/content
var PROPERTIES_FORM = "cq-sites-properties-form";

$document.on("foundation-contentloaded", function(){
$("#shell-propertiespage-doneactivator").on('click', function(e){

//validate 

});
});
});

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 NitroHazeDev

Sure @kautuk_sahni .HTH.

 

(function($document, $) {
"use strict";

//form id defined in /libs/wcm/core/content/sites/properties/jcr:content/body/content/content
var PROPERTIES_FORM = "cq-sites-properties-form";

$document.on("foundation-contentloaded", function(){
$("#shell-propertiespage-doneactivator").on('click', function(e){
alert("clicked");
var $propertiesForm = $("#" + PROPERTIES_FORM);
 //now set required fields required or perform further validations as need be,

}

});
});
})($(document), Granite.$);

1 reply

Level 9
December 21, 2021

All,

 

Resolved the issue. Thanks.

kautuk_sahni
Community Manager
Community Manager
January 5, 2022

Can you please share the way you resolved it? This would help in posterity. 

Kautuk Sahni
NitroHazeDevAuthorAccepted solution
Level 9
January 12, 2022

Sure @kautuk_sahni .HTH.

 

(function($document, $) {
"use strict";

//form id defined in /libs/wcm/core/content/sites/properties/jcr:content/body/content/content
var PROPERTIES_FORM = "cq-sites-properties-form";

$document.on("foundation-contentloaded", function(){
$("#shell-propertiespage-doneactivator").on('click', function(e){
alert("clicked");
var $propertiesForm = $("#" + PROPERTIES_FORM);
 //now set required fields required or perform further validations as need be,

}

});
});
})($(document), Granite.$);