listeners | Adobe Higher Education
Skip to main content
narayanank84409
Level 4
October 16, 2015
해결됨

listeners

  • October 16, 2015
  • 1 답변
  • 565 조회

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.

이 주제는 답변이 닫혔습니다.
최고의 답변: edubey

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 답변

edubey
edubey답변
Level 10
October 16, 2015

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.