listeners | Community
Skip to main content
narayanank84409
Level 4
October 16, 2015
Solved

listeners

  • October 16, 2015
  • 1 reply
  • 565 views

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.

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 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 reply

edubey
edubeyAccepted solution
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.