title: Using "if" inside an "onclick
body: <p><strong>Please before posting or commenting ... read and understand that this is inside an application that generates the web page and I cannot create a function I can only edit with will happen inside the onclick</strong></p>
  
  <p>Is it possible to use a "if" function inside an "onclick".</p>
  
  <p>The reason why I have to do this is because this "onclick" is used inside an application that I do not control the code, the only thing I can control is what happens inside the "onclick"</p>
  
  <p>For example:</p>
  
  <pre><code>onclick="document.getElementById('REF_DOC_1_NUMBER').value = '';"
  </code></pre>
  
  <p>I can write the:</p>
  
  <pre><code>document.getElementById('REF_DOC_1_NUMBER').value = '';
  </code></pre>
  
  <p>I cannot declare any function in the webpage... cause it's an application that compiles the pages... I can only write what is written in the tag onclick...</p>
  
  <p>But not a function. The page is generated by the application itself so I do not control the header.</p>
  
  <p>What I need, a IF that checks an other ID and to change the value ONLY if the value of the other ID (REF_DOC_1_CHOICE) is NA (not applicable)</p>
  
  <p>Any thoughts?</p>