Not possible to stop propagation of JavaScipt event (Submit) in JIRA 5.x.

Hi all,

when creating (editting) an issue in JIRA I need to check some fields if they are not empty or not selected and if so, stop the submission of the creating/editting the issue so that the user can fill in the fields. The problem is that if I try to use this style of the code

        return false;

The handling of the event goes well the problem is that even if the handling is executed and the propagation of the event should be stopped by the jQuery the submission still executes even though it enters the "if" and returns false. Is this some feature of JIRA 5.x where in popup window (create/edit screen) is impossible to do it this way? If so is there some workaround to stop submission or is this not allowed in JIRA 5.x at all?

Thanks for any info in advance.

2 answers

1 accepted

1 vote
Answer accepted

Hi all,

found the answer to this. It is necessary to use "before-submit" event for this. I.e.:

AJS.$('form').bind("before-submit", function(event){
        event.preventDefault(); // this will stop the event from further propagation and the submission will not be executed
        event.stopPropagation(); //not always necessary


I faced with that problem before but avoided it by disabling submit button when verification not right. This solution by you is fine too and I think that would use it in future. Thanks for you question and answer.

Can you please provide your code on how to disable to Submit / create button?

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Friday in United States

Confluence Security Advisory

Good morning Members, Not sure if you are aware. Please read the following: More details: https://co...

46 views 1 0
View post

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you