2 Replies Latest reply on Feb 4, 2014 10:16 AM by meljar

    Autofill a radio button using other radio buttons

    meljar Level 1

      I would like a question on my form "Q24 Decrease Smoke" (set of "Yes"/"No" radio buttons) to auto fill with a response of "No" if the user selects "Not at all" to 3 other questions (also sets of radio buttons).  If the user selects any other response to any of these 3 questions, I want the user to be able to manually select either "Yes" or "No". This is the code that I've tried, under the Mouse Up event of the "No" radio button option for Q24:


      var a = getField("Q20 Smoke Cig").value;

      var b = getField("Q22 Smoke other forms").value;

      var c = getField("Q23 chew/snuff").value;


      if(a=="Not at all" && b=="Not at all" && c=="Not at all") event.value = "On";


      I'm new to Javascript, so am not entirely sure I am on the right track or what might be wrong here. Any help would be greatly appreciated. Thanks!