0 Replies Latest reply on Mar 26, 2015 9:16 AM by milly mac

    radio button (or check box) clicked populates text field

    milly mac

      (hope I have the right forum area since things have changed . . .)

       

      Hello everyone!  I need a script that will populate a text field when a radio button (or check box) is clicked.  The one I have been working with has not been successful and I'm not really good with javascript.  Specifically, I have several glossary terms that I will use with the buttons or boxes (one for each term) and if the button/box is chosen, then I need the definition of that glossary term to populate a text field.  I've got the script below on "change"and "initialize" events - this is for a check box.  My drop-dead deadline is April 3rd - will try something else if I can't get this to work.

       

      Any help/guidance VERY MUCH APPRECIATED!

       

      function ckbox {

      if (ckbox.rawValue==1){

      cobx.form.definition.value="This is the definition of the glossary term";

      } else {

      ckbox.form.definition.value="hidden";

      }

      }

      <form>

      <input type="text" name="definition" />

      <input type="checkbox" name="Inquiry and Analysis" onclick="IAASWITCH(this)" />

      </form>

       

      Thank you!