Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Dialog box in JIRA

b
Contributor
April 15, 2012

Hi,

I want to use dialog box to display my custom content. Here's my code:

<script language="javascript" type="text/javascript">
			AJS.$(document).ready(function() {
			    var popup = new AJS.Dialog(860, 530);
			    AJS.$("#test-button").click(function() {
			        popup.show();
			    });
			});
		</script>

<button id="test-button">Test</button>

The trouble is that button is inside of form, so after click the popup is temporary displayed and I'm redirected to other/the same page.

3 answers

1 accepted

1 vote
Answer accepted
b
Contributor
April 15, 2012

The problem was with

<button id="test-button">Test</button>

after changing it to:

<input id="test-button" type="button" value="Test">

everything works fine!

0 votes
tousifs
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 15, 2012

Hi,

<button id="test-button"> Test </button> element no need to declare within form opening and form closing

it seems to be correct way.

button is diffrent from submit button so it wont go ahead next action.

0 votes
JamieA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 15, 2012

That doesn't really make sense, a <button> element should not submit the form. There must be more to this than what you have put in the question.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events