title: Jira custom fields - how to use jquery in velocity edit.vm
body: <p>I am trying to write some relatively simple custom field.</p>
  
  <p>This is an extract from my edit.vm:</p>
  
  <pre><code>$webResourceManager.requireResource("cz.firma.rozy:zakaznik")
  &lt;input id="test" style="width:500px"
         type="text" placeholder="Sem zadejte ID" value=""/&gt;
  &lt;button id="buttonID" &gt;Use ID&lt;/button&gt;
  </code></pre>
  
  <p>And here is my simple zakaznik.js:</p>
  
  <pre><code>AJS.$( "#buttonID" ).click(function() {
      AJS.$("#test").hide();
  });
  </code></pre>
  
  <p>Finally atlassian-plugin.xml</p>
  
  <pre><code>&lt;web-resource key="zakaznik-resources" name="zakaznik Web Resources"&gt;
      &lt;dependency&gt;com.atlassian.auiplugin:ajs&lt;/dependency&gt;
      &lt;dependency&gt;com.atlassian.auiplugin:jquery&lt;/dependency&gt;
      &lt;dependency&gt;com.atlassian.auiplugin:jquery-ui-other&lt;/dependency&gt;
      &lt;dependency&gt;com.atlassian.auiplugin:aui-select2&lt;/dependency&gt;
      &lt;context&gt;atl.general&lt;/context&gt;
      &lt;context&gt;atl.admin&lt;/context&gt;
      &lt;resource type="download" name="zakaznik.css" location="/css/zakaznik.css"/&gt;
      &lt;resource type="download" name="zakaznik.js" location="/js/zakaznik.js"/&gt;
      &lt;resource type="download" name="images/" location="/images"/&gt;
      &lt;context&gt;zakaznik&lt;/context&gt;
    &lt;/web-resource&gt;
  
  ...
    &lt;customfield-type name="Pridani zakaznika" i18n-name-key="customer-add.name" key="customer-add" class="cz.firma.rozy.jira.customfields.CustomerCustomField"&gt;
      &lt;description key="customer-add.description"&gt;Plugin, ktery prida zakaznika z abry&lt;/description&gt;
      &lt;resource name="view" type="velocity" location="templates/viewCustomer.vm"/&gt;
      &lt;resource name="edit" type="velocity" location="templates/edit.vm"/&gt;
    &lt;/customfield-type&gt;
  </code></pre>
  
  <p>Plugin is successfully built and installed in JIRA (v6.2.3) and I can add this field to any screen. When I click on this added button, I would like to see, that input is hidden.  When I click on my button, nothing is done and editing mode is closed.</p>
  
  <p>What am I doing wrong?</p>