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

Question

Question

Find the radio button belonging to a collection

asked on August 2, 2017

Good morning,

This is in reference to another post that I have open, but I think it would help me out if I understand this first.

What I'm trying to find is the radio button that belongs to a collection. For example if I have a field and a radio button together in a collection. I want to alert each value of the radio button. So I have something like the code below, but all I get is "Undefined" for each radio value.

How can I tweak this? I've seen that this works for "select" drop-down menus but I can't make it work for radio buttons.

      $('.somefield input').each(function () {    
        
       var myRadio = $(this).find('.radio input:checked').val();

       alert(myRadio);
                            
                            
      });

 

0 0

Replies

replied on August 2, 2017 Show version history

Hi Raul,

Just wanted to let you know that I've been working on a solution to this when I've had some down time. Unfortunately, it's not as straightforward as either of us would like--when I target the radio buttons in the Console, it get the value I would expect. Using the same code in the JavaScript section of the Forms designer, I also get 'undefined'. I haven't been able to nail down a reason for this despite all the research I've been doing.

Anyway, I'm confident we'll get this figured out soon!

~Rob

0 0
replied on August 2, 2017

Thanks Rob,

I was able to come up with a solution on my original post, but I'm still interested in how I would go about doing it using the JavaScript approach. Will keep searching when I find some time as well.

 

Original Post with alternate solution: https://answers.laserfiche.com/questions/125224/Sum-items-in-collection-only-if

 

Thanks again Rob!

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

Sign in to reply to this post.