jquery.repeater icon indicating copy to clipboard operation
jquery.repeater copied to clipboard

SetList CheckBox value

Open matejkr opened this issue 7 years ago • 6 comments

There is an issue with setting CheckBox values from JSON array

myJson = '{"group-a":[{"text-input1":"1","text-input2":"27","checkBox":["on"]}]}';

All values to input get set normaly. CheckBox stays unsetted.

Regards

matejkr avatar Oct 16 '17 07:10 matejkr

I am having the same issue. @matejkr did you found the way out?

daywong1119 avatar Apr 10 '18 05:04 daywong1119

Same issue. Was this resolved? Work around? @matejkr @daywong1119 did you guys figure out a work around or the solution?

Thanks/Alain

alainjlavoie avatar Feb 12 '19 00:02 alainjlavoie

Hi, I had the same problem but solved it by setting an explicit "value" attribute on the checkbox, eg:

<input type="checkbox" name="checkBox" value="on">

pauljura avatar Aug 19 '19 04:08 pauljura

Anyone solved this?

Virelox avatar Oct 05 '20 12:10 Virelox

Please, did anyone get to solve this error? Thanks

paulayo93 avatar Mar 04 '21 09:03 paulayo93

@paulayo93 I've solved this issue in my situation,

<div ....>
<input type="checkbox" name="payment[]" value="bank" >
<input type="checkbox" name="payment[]" value="cash" >
<input type="checkbox" name="payment[]" value="credit"> 

</div...>

$repeater.setList([
    {
       "payment" = ["bank", "cash"],
       ....
    },
)]

So after that my checkbox with value "bank" and "cash" wil be checked.

bekanur98 avatar Mar 29 '21 12:03 bekanur98