How to submit a form inside a gadget

Hi all,

I am newbie to JIRA gadgets. I have created a JIRA gadget with the help of the tutorials.Will i be able to insert a form inside gadget and submit it? In that case what should be done to create a form inside the gadget. Upon clicking the submit button how this should be processed? how should the result be displayed inside the gadget? What about prepopulated fields like <select> field . How can the data be prepopulated upon displaying the gadget? Please give me some hints

3 answers

1 accepted

Accepted Answer
0 votes

Yes we have to write the html form code within the gadget.xml

We need not use the form tag. Instead ajax calls can be done to submit the data

You should certainly be able to do this. The gadget view is constucted using html elements and the interaction with server is done using REST. When you submit the form, you will have to use Ajax to capture the results and render it properly on the page. Easier said than done ;)

0 votes

You should certainly be able to do this. The gadget view is constucted using html elements and the interaction with server is done using REST. When you submit the form, you will have to use Ajax to capture the results and render it properly on the page. Easier said than done ;)

I understand that in the gadget.xml we should write javascript for displaying the datas. Will i be writing the whole html form code within the gadget.xml? Is there any good example ?

I understand that in the gadget.xml we should write javascript for displaying the datas. Will i be writing the whole html form code within the gadget.xml? Is there any good example ? Also you said about submitting the form. Where and how would i handle the ajax call? how to i process and give back the result.

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Tuesday in Featured Groups

Tuesday tips & tricks: What is the Atlassian Community?

It's officially Tuesday, which means it's officially time for another tip to help you better navigate this space we call the Atlassian Community. 😄 I got a great question from community member, Sa...

91 views 3 6
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