Michael4771079
Posts: 0
Joined: Sat Jul 21, 2012 2:03 pm

saving radiobuttongroup value

forgot to say, just in case code is run on order button

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

saving radiobuttongroup value

Will take a look, but this will take some time.

Michael4771079
Posts: 0
Joined: Sat Jul 21, 2012 2:03 pm

saving radiobuttongroup value

OK lllya,
I understand.

Thanks

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

saving radiobuttongroup value

Hi Michael,

To reach your goal you need:

  1. Find needed grid cell.

  2. Find checked input.

  3. Get this input value.

    Here is a worked code:

    pre

    //Where "mobilegridcell_46_319_350" is gridcell name with goal radiogroup inside.
    var radioValue = $grid.find("[name='mobilegridcell_46_319_350'] input:checked").val();

    /pre

    Regards.

Michael4771079
Posts: 0
Joined: Sat Jul 21, 2012 2:03 pm

saving radiobuttongroup value

thanks Yurii,
but how do I intergrate it with this code to save it to same array as other components

thanks

$grid = $(this).closest("[name=chickenpizzamobilegrid]");
save({'Kebab':$grid.find("[name=chickenpizza_item_label]").text(),

'Served_With':$grid.find("[name=mobileradiogroup1]").val(),

'Price':$grid.find("[name=chickenpizzaPricelabel]").text()},
"kebabArray");

Michael4771079
Posts: 0
Joined: Sat Jul 21, 2012 2:03 pm

saving radiobuttongroup value

also as the page is populated by rest service, I cant code this as every mobilegrid and mobilegridcell will have different index

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

saving radiobuttongroup value

Hi Michael,

You just need to use "radioValue" value in the variable you need.

pre

$grid = $(this).closest("[name=chickenpizzamobilegrid]");

//Where "mobilegridcell_46_319_350" is gridcell name with goal radiogroup inside.
var radioValue = $grid.find("[name='mobilegridcell_46_319_350'] input:checked").val();

save({'Kebab':$grid.find("[name=chickenpizza_item_label]").text(),

'Served_With': radioValue,

'Price':$grid.find("[name=chickenpizzaPricelabel]").text()},
"kebabArray");

/pre

Regards.

Michael4771079
Posts: 0
Joined: Sat Jul 21, 2012 2:03 pm

saving radiobuttongroup value

Hi Yurii,
this solution works great for me, I was able to add my second radiobutton group as well!

Thanks for your input here, its very much appreciated

Best!
Michael

code$grid = $(this).closest("[name=chickenpizzamobilegrid]");
//Where "mobilegridcell_46_319_350" is gridcell name with goal radiogroup inside.
var radioValue = $grid.find("[name='mobilegridcell_46_319_350'] input:checked").val();
var radioValue2 = $grid.find("[name='mobilegridcell_458'] input:checked").val();
save({'Kebab':$grid.find("[name=chickenpizza_item_label]").text(),
'Served_With': radioValue,
'Sauce': radioValue2,
'Price':$grid.find("[name=chickenpizzaPricelabel]").text()},
"kebabArray");/code

Return to “Issues”