It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Input element causes stuck on drop down menu

Hi all,

I have a plugin in JIRA 5.0 using Web work.

In input.vm, I place an File input element. Using Web item to navigate to plugin.

After open my plugin, all drop down menus are stuck. Nothing happen when clicking on it.

It does not happen when I remove File input element.

Anyone could explain this and how can I use Input file element in file .vm?

Thanks in advance,

2 answers

1 vote
Joe Clark Atlassian Team Mar 15, 2012

You should check the JavaScript console from any errors that occur during the page load.

Is your input element wrapped within a form? If not, it probably should be :-)

Thanks Joseph so much, It seems you guide me the right way. My form contains only input file element. But I got JS error: "uncaught exception: Unable to find maximum upload size on form." I think this is required by Jira 5.0 I try to set upload size of the input file element but unsuccessfully. Do you know to to set this value? Thanks in advance,
Timothy Community Leader Jan 08, 2013

Oh the joy. Somehow, when using an type="file" input tag, Atlassian's Javascript asks for two tags to be in the form:

  1. A div where the id is "attach-max-size"
  2. An input field where the name is "id"


You seem to have figured this out. Adding the elements you described isn't resolving the error for me. Can you provide more details on what you added to your form? Here is the content of my form:

<input type="hidden" name="pID" value="$metadata.projectID">
								<input type="hidden" name="pDocAO" value="$pDocAO">
								<input id="fileToUploadInput" type="file" name="attach1" size="30">
								<input type="hidden" name="id" value="">
								<div id="attach-max-size"></div>

But I still get the same error.


Timothy Community Leader Feb 06, 2013

Just think of it in this way. If you use the input="file", AJS will pick up on it and will act on in. Therefore, you can refer to how JIRA does the file import.

So, if you provide id's without values, it's definately not going to work.

<div id="attach-max-size" class="hidden">$attachmentSize</div>

<input type="hidden" id="id" name="id" value="$randomId" />

Note, both my values have meaning. The attachment size is JIRA's attachment size limit. Random Id is the id of the issue that I am refering to.


Thanks for the clarification. I've explored your suggestions and it works as you describe.

I'm upgrading a custom plugin from 4.4.x to 5.2.5 and one of the things we do in this plugin is provide the ability to attach files at the project level, not just at the issue level. I'm not just providing a different way to create issue attachments. So, the restriction to match an issue id is not applicable. To your knowledge, is there a way to override or skip this built-in validation? It's quite annoying for my purposes.

I don't want any of Atlassian's fancy javascript validation or form manipulation for file uploads. I just want to control the UI and form elements myself. This includess not having the js code convert the input type="file" element to a checkbox for multiple file uploads. I want to shut this code off. Ideas?


I found the answer and it is documented here: How to ignore-inline-attach.

This is exactly the type of solution I was hoping to find. Very easy.

Try this code. It work for me.

<div class="field-group">
<label class="field-label" for="attachment">Attachment <span class="vp-optional">(optional)</span></label>
<div class="field-container">
<div id="attach-max-size" class="hidden">15728640</div>
<input id="attachment" type="file" name="attachment"/>
<div class="hidden"><input type="hidden" value="14000" name="pid"></div>

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Marketplace Apps & Integrations

Expose your beautifully crafted Dashboard through the Jira Service Desk Customer Portal

  A picture is worth a thousand words, especially when you're trying to find relationships and understand your data. Here, Dashboards play a vital role in gaining insights from a variety of dat...

359 views 5 4
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you