Touch UI dialog validation - 6.3 | Community
Skip to main content
Level 2
May 30, 2018
Solved

Touch UI dialog validation - 6.3

  • May 30, 2018
  • 3 replies
  • 2859 views

I was just testing some dialog validation and no matter what I do the form always saves and closes.

(function (document, $, ns) {

    "use strict";

   

    $(document).on("click", ".cq-dialog-submit", function (e) {

        e.stopPropagation();

        e.preventDefault();

        ns.ui.helpers.prompt({

            title: Granite.I18n.get("Invalid Input"),

            message: "Invalid input.",

            actions: [{

                id: "CANCEL",

                text: "CANCEL",

                className: "coral-Button"

            }],

            callback: function (actionId) {

                if (actionId === "CANCEL") {

                }

            }

        });

    });

   

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

This is in the clientlibs of my component. My understanding is that when the submit button of the form is clicked, you will receive the invalid input dialog and be sent back to the dialog of the component. The Invalid Input dialog shows up, but the dialog of the component saves and closes.

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,

Which version are you using? I tried your code in 6.3

Its working as expected.

"when the submit button of the form is clicked, the invalid input dialog shows up and after clicking on cancle button in invalid input dialog, I sent back to dialog of the component."

Thanks

Arun

3 replies

arunpatidar
Community Advisor
arunpatidarCommunity AdvisorAccepted solution
Community Advisor
May 30, 2018

Hi,

Which version are you using? I tried your code in 6.3

Its working as expected.

"when the submit button of the form is clicked, the invalid input dialog shows up and after clicking on cancle button in invalid input dialog, I sent back to dialog of the component."

Thanks

Arun

Arun Patidar
jdawyersAuthor
Level 2
May 31, 2018

I'm using 6.3. Must be something with my instance. I'll try a fresh one. Thanks!

Level 2
December 4, 2019

This is not working for submit dialog of page properties in 6.4.