page create button its id is update in service pack 18 to coral-id-12 from 11.
now it is causing the issue on logics implemented by using coral-id.
next time onwards we have to avoid this kind of issue. is there any solution for this?
any OOTB validator we have for this other than Submit?
Solved! Go to Solution.
Views
Replies
Total Likes
Hi @SudarshanV1
Which create button are you talking about? create button at page property. If yes then you can write a validation on form submit event.
Example :
document.querySelector(".cq-siteadmin-admin-createpage").addEventListener("submit", function(e){
if(!isValid){
e.preventDefault(); //stop form from submitting
}
});
Another way could be using selector based on button type
.coral3-Button[type="submit"]
Hi @SudarshanV1
Which create button are you talking about? create button at page property. If yes then you can write a validation on form submit event.
Example :
document.querySelector(".cq-siteadmin-admin-createpage").addEventListener("submit", function(e){
if(!isValid){
e.preventDefault(); //stop form from submitting
}
});
Another way could be using selector based on button type
.coral3-Button[type="submit"]
thanks this is working
Hi @SudarshanV1 ,
You should not write your logics based on coral-id- , since it can change based on the number of coral items on the page or a dashboard - sites dashboard in your case, you should instead target a specific class which is only for the create button e.g. granite-collection-create and restrict the functionality by path.
Or rather overlay the functionality altogether so that in future you have more control over the button.
Regards,
Anupam
not this.. while create page after selecting template.
is there any documentation for this to target class instead of id?
if yes can you share me pls
Views
Like
Replies
Views
Likes
Replies