You are viewing limited content. For full access, please sign in.

Question

Question

Laserfiche form- Cascading radio buttons with JavaScript

asked on June 7, 2016 Show version history

Hi,

I'm very new to the Laserfiche world and need to implement a form that has got two radio button list and each have 4 items in which are exactly the same.

Radio  button 1:

item1

item2

item3

item4

 

Radio Button 2:

item1

item2

item3

item4

 

I need to hide the item in the second checklist if it's selected in the first one. is there anyway to do it with JavaScript?

Thanks,

Mary

0 0

Answer

SELECTED ANSWER
replied on June 8, 2016

Mary,

If you're looking to hide the button so it can't be picked again, try this:


   $('.RadioButtonOne').click(function HideStuff() { 
     var choice = $('#q16 input:checked').val();
         if (choice == 1){
        $('#Field17-0').hide('slow');
        $('#Field17-1').show('slow');
        $('#Field17-2').show('slow');
    }
    else if (choice == 2){
        $('#Field17-1').hide('slow');
        $('#Field17-0').show('slow'); 
        $('#Field17-2').show('slow');
      }
    else if (choice == 3){
        $('#Field17-2').hide('slow');
        $('#Field17-1').show('slow');
        $('#Field17-0').show('slow');
         }
         });

 

Ok, the "choices" are the value fields for the selections.  In the forms editor, set the choices to have values (I just picked 1, 2, and 3 for the three fields).  Then, assign a name to the class under the "advanced" tab...in the case above I picked "RadioButtonOne", just so you know where they came from.  Use whatever names you like there, just make sure they match.  Use the appropriate field numbers for whichever field your radio button is in and you should be good to go.

1 0
replied on June 8, 2016

Hi Rick,

 

Thank you very much, that's what exactly I'm after. Will give it a go and let you know the result :)

Thanks,

Mary

0 0

Replies

replied on June 8, 2016

1 0
replied on June 8, 2016

You can use Field Rules in Forms to archive this, the field rule likes following:

 

0 0
replied on June 8, 2016

thanks for the reply. but this will hide the whole radio button items.

I have 2 radio button that have 4 items . I need to eliminate any item in the second radio button , if it's selected in the fist radio button.

 

0 0
replied on June 8, 2016 Show version history

Thanks you Rick, It all wrked well!

0 0
replied on June 9, 2016

Glad I could help!

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.