title: How do I dynamically set the "required" status of fields in Acrobat?
body: <p>I have an Acrobat PDF that a colleague would like some form validation added to beyond the simple options that Acrobat gives you without using javascript. From what I can tell, Javascript will be required to do this. I <strong>think</strong> the behavior should be able to be done via the "Add an Action->MouseDown->Run a Javascript" option found in Properties->Actions of the radio button group.</p>
  
  <p>Basically I have a group of radio buttons with 3 buttons. If buttonA is pressed, I'd like fieldA to be required. If buttonB is pressed, I'd like fieldB to be required. The same for buttonC/fieldC.</p>
  
  <p>I know what my pseudo code is going to look like but I'm having trouble translating it into javascript</p>
  
  <pre><code>onSelectionChanged(selection) {
      fieldA.required = false;
      fieldB.required = false;
      fieldC.required = false;
  
      if (selection == 'A') { fieldA.required = true; }
      if (selection == 'B') { fieldB.required = true; }
      if (selection == 'C') { fieldC.required = true; }
  }
  </code></pre>
  
  <p>Can anyone point me in the right direction? Thank you in advance.</p>