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

c15r error with checkbox

Hi Yurri,
thanks for you time on this,
maybe I didn't explain correctly.
Have a look at this s/s
1 is orderlabel,
2 is hampizzaPricelabel

Image

On the radio button the "TexT" is 9 Inch "Value" is £5.00

Image

When page loads a service is mapped to the grid, and on this screen there it prints 5 grids and collapsibles,
s/s attached

Image

Image

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

c15r error with checkbox

when user click an option from radiobuttongroup the selection is printed in the orderlabel and hampizzaPricelabel for the collapsible it was clicked in

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

c15r error with checkbox

Here is the desired result.
Hope this helps.

BEST!

Image

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

c15r error with checkbox

CORRECTION
"when user clicks an option from radiobuttongroup the selection is to be printed in the orderlabel and hampizzaPricelabel for the collapsible it was
clicked in "

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

c15r error with checkbox

Hi Michael,

Yes it was not clear.

But this time seems to be ok.(you need on click by radiobutton - move this radio item visible value to that label)

Here is code for this goal:

pre

console.log(this);
var currentText = jQuery(this).text();

//Current collapsibleset item.
var currentCollapsible = jQuery(this).closest('[data-role="collapsible"]');
//orderlabel in the current collapsible set item.
var orderlabel = currentCollapsible.find('[name="orderlabel"]');

orderlabel.text(currentText);

/pre

Please try it currently in your app by clicking on 14inch ... item.

Regards.

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

c15r error with checkbox

Hi Yurri,
the code above works great,
I tried to adjust it to get the value of the radiobutton on click event with the following code but my alteration didnt work

codeconsole.log(this);
var currentVal = jQuery(this).val();
//Current collapsibleset item.
var currentCollapsible = jQuery(this).closest('[data-role="collapsible"]');
//orderlabel in the current collapsible set item.
var hampizzaPricelabel = currentCollapsible.find('[name="hampizzaPricelabel"]');
hampizzaPricelabel.val(currentVal);
/code

Egor Kotov6832188
Posts: 0
Joined: Wed Nov 19, 2014 5:15 pm

c15r error with checkbox

Hello Michael.

Try next:
var hampizzaPricelabel = currentCollapsible.find('input:checked');
hampizzaPricelabel.siblings('label').text("New val");

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

c15r error with checkbox

Hi Egor,
Thanks for the reply

I tried the code but no luck, here are some screenshots
I ran the code on click radiobuttion "14 Inch" and "12 Inch stuffed crust

The value does not print when I click the radiobuttons, and if I click 14 inch and then 12 inch stuffed crust no values print and the text on the radio button changes.
See screenshots.
No errors in console

Image
Image

Image

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

c15r error with checkbox

HI,can I just add,
none of the code works on the iphone,
I scan the qr code iphone 5 7.02 the code from Yurri or Egor dont seem to fire

They work as described above in the browser

Thanks

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

c15r error with checkbox

Hi Michael,

Please use "Change value" event instead of "Click".

Regards.

Return to “Issues”