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

Question

Question

List items checked from check boxes

asked on October 22, 2015

I have a form that in the business process I need to inform several people of the check boxes checked in a certain field in the form.

Then this is what I would like to send with a service task:

I have tried using Java Script to fill in a hidden fields and can get it to work but not the way it should.  I can get it to fill the field, but not take it away if I uncheck one of the options.  (My scripting skills are sorely lacking!)  If someone knows a way to pull the list straight into the email section of a service task or can help with some better scripting that I can do.  I would be most thankful!

 

0 0

Answer

SELECTED ANSWER
replied on October 22, 2015

I'd say you're on the right track with the Javascript. Try something like this (replace the ids #q3 and #q4 with your checkbox ID and hidden field ID respectively).

$(document).ready(function(){
  $('#q3 input').on('change',function(){
    var str = "";
    $('#q3 input:checked').each(function(){
      if(str!="") str = str+", ";
      str = str+$(this).val();
    });
    $('#q4 input').val(str);
  });
});

 

0 0
replied on August 4, 2023

I have not been able to get this to work, has anyone had success or another way to get checkbox answers into a field?

0 0

Replies

replied on October 22, 2015

That worked perfectly!  Thank you so much!!!

0 0
replied on November 3, 2015

Hi there,

If you use the checkbox variable directly, it should also show the value of the options you selected.

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

Sign in to reply to this post.