17 Replies Latest reply on May 29, 2014 6:31 AM by narnee

    hiding radio buttons

    narnee

      well, i've been up all night trying to figure this out on my own. no luck. i am print designer (25 years experience) and i accepted a project to design an interactive pdf form. on the initial overview of the form and watching some lynda.com training, i felt i could tackle it with no issue.

       

      THEN, client sent additional info, requesting that some of the options be hidden if other options were selected. that is where i am having trouble. as i understand it, this requires my writing java script. oh my!

       

      i've read some threads here and have tried to apply them (with adjustments in button names) with absolutely no success.

       

      i have 2 buttons:

      button 1:

      general:  Type of Bill

      options: radio button choice: Admission Status

       

      below this selection is a table with it's own set of radio buttons (where they chose 1)

      within that table there are 8 buttons:

      general: Admission Status

      options: radio button choices (there are 8 buttons here): 33X, 34X, 12X, 31X, 32X, 82X, 81X and Other

       

      now, button 2 (which falls below the table of radio buttons):

      general: Type of Bill

      options: radio button choice: Claim Status

       

      trick is, if they end up selecting button 2, the table of 8 radio buttons above it needs to not be accessible... they should not be able to interact with that table's radio buttons, but i don't want it to necessarily hide/disappear.

       

      any help would be so greatly appreciated.

       

      this little experience so far has made me realize just how easy i have had it for so many years designing print work!

        • 1. Re: hiding radio buttons
          try67 MVP & Adobe Community Professional

          So basically you want to disable (ie, set as read-only) the 8 radio-buttons

          associated with the "Admission Status" option when that option is not

          selected, and enable them when it is, right?

          • 2. Re: hiding radio buttons
            narnee Level 1

            hi gilad - let me attach a picture... that might help...

             

            Screen Shot 2014-05-29 at 3.53.17 AM.png

            when the admission status is selected, they are able to select from the additional / separate selections within the table... but if they select 'claim status' radio button below the table, there should be no availability to them to the options in the table...

             

            for instance, if for some reason they mistakenly selected admission status and a number in the table, then realized, that no, they need to select 'claim status' any option they and previously selected in that table needs to go away (not be available to them) once 'claim status' is selected.

             

            note: the 'admission status' and 'claim status' buttons are in the same radio button 'group'

            and

            all the radio buttons inside of that table are a different radio button group...

             

            does that make sense? i feel like i navigating very foreign waters here...

            • 3. Re: hiding radio buttons
              try67 MVP & Adobe Community Professional

              Yes, I understood that. So here's what you can do. Place this code as the MouseUp event of each of the main radio-buttons:

               

              updateStatus();

               

              And then insert this code as a document-level script (via Tools - Document JavaScripts):

               

              function updateStatus() {

                  if (event.target.value=="Admission Status") {

                      this.getField("Admission Status").readonly = false;

                  } else {

                      this.resetForm(["Admission Status"]);

                      this.getField("Admission Status").readonly = true;

                  }

              }

              • 4. Re: hiding radio buttons
                narnee Level 1

                this is a *NEW EMAIL ADDRESS* notification, NOT a vacation response...

                 

                my new email address is:

                 

                susanellisonart@icloud.com

                 

                this will be my primary business email address account going forward.

                 

                thank you - susan

                • 5. Re: hiding radio buttons
                  try67 MVP & Adobe Community Professional

                  Please disable your automatic email notification message.

                  • 6. Re: hiding radio buttons
                    narnee Level 1

                    i did a few minutes ago when i saw that happening... let me go back and double check. my apologies. it should not happen again. unfortunately, i'm not being given an option to delete the one still remaining.

                    • 7. Re: hiding radio buttons
                      narnee Level 1

                      i'm going to try this. amazing, as there is no way my brain could configure this right now. it may take me a bit to digest and apply... but i'll be back. thank you!!!

                      • 8. Re: hiding radio buttons
                        try67 MVP & Adobe Community Professional

                        I couldn't update my original reply, but the correct location for the script is: Tools - JavaScript - Document JavaScripts

                        • 9. Re: hiding radio buttons
                          narnee Level 1

                          i'm sure your directions are good, but i'm fuzzy on interpretation, due to my lack of code-speak (and exhaustion)... i'll keep trying.

                          • 10. Re: hiding radio buttons
                            narnee Level 1

                            hi kind gilad - i've tried (to the best of my ability) to make these additions, but no luck. i'm sure it is my own user error... here are a couple of screen shots. maybe you will see where i am going wrong...

                             

                            Screen Shot 2014-05-29 at 7.06.08 AM.png

                             

                            and......

                             

                            Screen Shot 2014-05-29 at 7.08.59 AM.png

                            • 11. Re: hiding radio buttons
                              try67 MVP & Adobe Community Professional

                              Seems OK. So what's actually happening when you click one of the main

                              radio-buttons?

                              Also, are there any error messages in the JS Console (Cmd+J)?

                              • 12. Re: hiding radio buttons
                                narnee Level 1

                                i'm sure these are errors i have placed within the file in my many attempts to make this work, but i have no idea why any of it would still be there as i 'delete' the fields every time i replace with new script... i'm so sorry... i'm obviously completely clueless on this coding stuff!!!

                                 

                                but, none of the actions have changed so far... but maybe this is why... errors when i enter command J...

                                 

                                i did delete all of this from that field, and it is gone, but maybe that was a mistake too, as there still is no configuration adjustment on the buttons.

                                 

                                 

                                 

                                Acrobat EScript Built-in Functions Version 11.0

                                Acrobat SOAP 11.0

                                 

                                 

                                ReferenceError: disable_radio_buttons_DDC is not defined

                                1:Field:Mouse Up

                                ReferenceError: disable_radio_buttons_DDC is not defined

                                1:Field:Mouse Up

                                SyntaxError: missing } in compound statement

                                17:

                                TypeError: this.getField("Type_of_Bill - Claim_Status") is null

                                1:Field:Mouse Up

                                TypeError: this.getField("Type_of_Bill - Claim_Status") is null

                                1:Field:Mouse Up

                                TypeError: this.getField("Type_of_Bill - Claim_Status") is null

                                1:Field:Mouse Up

                                SyntaxError: missing } after function body

                                39:

                                SyntaxError: missing } after function body

                                39:

                                SyntaxError: missing } after function body

                                39:

                                SyntaxError: syntax error

                                22:

                                SyntaxError: syntax error

                                22:

                                SyntaxError: syntax error

                                22:

                                SyntaxError: syntax error

                                22:

                                SyntaxError: syntax error

                                22:

                                SyntaxError: syntax error

                                22:

                                SyntaxError: syntax error

                                22:

                                SyntaxError: syntax error

                                22:

                                SyntaxError: syntax error

                                22:

                                SyntaxError: syntax error

                                22:

                                SyntaxError: syntax error

                                22:

                                SyntaxError: syntax error

                                22:

                                SyntaxError: syntax error

                                22:

                                SyntaxError: syntax error

                                22:

                                SyntaxError: syntax error

                                22:

                                SyntaxError: syntax error

                                22:

                                SyntaxError: missing ( before formal parameters

                                1:

                                SyntaxError: missing ( before formal parameters

                                1:

                                SyntaxError: missing ( before formal parameters

                                1:

                                TypeError: this.getField("33X") is null

                                6:Field:Mouse Up

                                TypeError: this.getField("33X") is null

                                6:Field:Mouse Up

                                TypeError: this.getField("33X") is null

                                6:Field:Mouse Up

                                TypeError: this.getField("Admission Status") is null

                                6:Field:Mouse Up

                                TypeError: this.getField("Admission Status") is null

                                3:Field:Mouse Up

                                TypeError: this.getField("Admission Status") is null

                                6:Field:Mouse Up

                                TypeError: this.getField("Admission Status") is null

                                6:Field:Mouse Up

                                TypeError: this.getField("Admission Status") is null

                                6:Field:Mouse Up

                                TypeError: this.getField("Admission Status") is null

                                3:Field:Mouse Up

                                TypeError: this.getField("Admission Status") is null

                                6:Field:Mouse Up

                                TypeError: this.getField("Admission Status") is null

                                6:Field:Mouse Up

                                SyntaxError: missing ( before formal parameters

                                1:

                                TypeError: this.getField("Admission Status") is null

                                6:Field:Mouse Up

                                TypeError: this.getField("Admission Status") is null

                                6:Field:Mouse Up

                                TypeError: this.getField("Admission Status") is null

                                3:Field:Mouse Up

                                TypeError: this.getField("Admission Status") is null

                                3:Field:Mouse Up

                                TypeError: this.getField("Admission Status") is null

                                6:Field:Mouse Up

                                TypeError: this.getField("Admission Status") is null

                                6:Field:Mouse Up

                                TypeError: this.getField("Admission Status") is null

                                6:Field:Mouse Up

                                TypeError: this.getField("Admission Status") is null

                                6:Field:Mouse Up

                                TypeError: this.getField("Admission Status") is null

                                6:Field:Mouse Up

                                TypeError: this.getField("Admission Status") is null

                                3:Field:Mouse Up

                                TypeError: this.getField("Admission Status") is null

                                3:Field:Mouse Up

                                TypeError: this.getField("Admission Status") is null

                                6:Field:Mouse Up

                                • 13. Re: hiding radio buttons
                                  try67 MVP & Adobe Community Professional

                                  This means the name of the field in the script does not match the actual

                                  field name in your file.

                                  Double-check it's correct and keep in mind it's case-sensitive.

                                  • 14. Re: hiding radio buttons
                                    narnee Level 1

                                    it does match???

                                     

                                    here are the fields again:

                                     

                                    i have 2 buttons:

                                    button 1:

                                    general: name:     Type of Bill

                                    options: radio button choice:     Admission Status

                                     

                                    below this selection is a table with it's own set of radio buttons (where they chose 1)

                                    within that table there are 8 buttons:

                                    general: name:     Admission Status

                                    options: radio button choice(s):      (there are 8 buttons here): 33X, 34X, 12X, 31X, 32X, 82X, 81X and Other

                                     

                                    now, button 2 (which falls below the table of radio buttons):

                                    general: name:     Type of Bill

                                    options: radio button choice:      Claim Status

                                     

                                    the 8 buttons (33X, 34X, etc etc) are still able to be selected when "Claim Status" is selected...

                                     

                                    ???

                                     

                                    those TOB numbers should only 'work' with the above 'Admission Status'...???

                                     

                                    you are a kind soul!

                                     

                                    Screen Shot 2014-05-29 at 8.38.00 AM.png

                                    • 15. Re: hiding radio buttons
                                      try67 MVP & Adobe Community Professional

                                      Can you share the file via dropbox, acrobat.com, or email?

                                      • 16. Re: hiding radio buttons
                                        narnee Level 1

                                        sure. will you send me your email address... you can use either of those addresses above from my annoying auto response from earlier. and then i'll send over to you. thanks!!!!!!!!!!

                                        • 17. Re: hiding radio buttons
                                          narnee Level 1

                                          you are an ANGEL Gilad! i am so grateful for your kind and patient assistance with this. thank you thank you thank you!!!!!