Page 2 of 2

saving radiobuttongroup value

Posted: Fri Apr 03, 2015 8:30 pm
by Michael4771079

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


saving radiobuttongroup value

Posted: Fri Apr 03, 2015 8:39 pm
by Illya Stepanov

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


saving radiobuttongroup value

Posted: Fri Apr 03, 2015 8:41 pm
by Michael4771079

OK lllya,
I understand.

Thanks


saving radiobuttongroup value

Posted: Mon Apr 06, 2015 10:10 pm
by Yurii Orishchuk

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.


saving radiobuttongroup value

Posted: Mon Apr 06, 2015 11:07 pm
by Michael4771079

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");


saving radiobuttongroup value

Posted: Mon Apr 06, 2015 11:10 pm
by Michael4771079

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


saving radiobuttongroup value

Posted: Wed Apr 08, 2015 1:38 am
by Yurii Orishchuk

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.


saving radiobuttongroup value

Posted: Thu Apr 09, 2015 12:57 am
by Michael4771079

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