コミュニティアチーブメントバーを展開する。

Submissions are now open for the 2026 Adobe Experience Maker Awards.

Mark Solution

この会話は、活動がないためロックされています。新しい投稿を作成してください。

解決済み

listeners

Avatar

Level 4

1.Based on condition i fired alert from Jsp, alert working properly, control is not stop after that.

<script type="text/javascript">

                        alert("value Exist");

                        return false; // Control is not returning from here, 

  </script>

2. I gave listener in dialog, to trigger alert, it's working and control stop there itself.

but each and every time am getting alert.

In Jsp:

<script type="text/javascript">

function alerting(dialog){

                       alert("value Exist");

                     }

                </script>

In dialog.xml i gave

 <listeners jcr:primaryType="nt:unstructured"

    beforesubmit="function(dialog){alerting(dialog); return false;}"/> --> am getting alert in all the times, when i press ok.

 

Please, guide me to get alert when condition satisfied.not on all the times.

1 受け入れられたソリューション

Avatar

正解者
Level 10

Hi,

You have used beforesubmit listener in your dialog which executes everytime you are trying to submit the dialog. When this listerner is called you method executes.

If you want to perform some validation, then please return false,  only in case where you do not want user to submit the dialog and he should input correct values.

else return true if your validation are fine and you are happy with the input values.

元の投稿で解決策を見る

1 返信

Avatar

正解者
Level 10

Hi,

You have used beforesubmit listener in your dialog which executes everytime you are trying to submit the dialog. When this listerner is called you method executes.

If you want to perform some validation, then please return false,  only in case where you do not want user to submit the dialog and he should input correct values.

else return true if your validation are fine and you are happy with the input values.