Page 1 of 2

Change words on toggle component

Posted: Fri Feb 08, 2013 1:42 pm
by Michael4771079

Hi,
can I change the text on the toggle component from on, off, to yes and no


Change words on toggle component

Posted: Fri Feb 08, 2013 2:03 pm
by Maryna Brodina

Hello! Yes, you can do that using JS


Change words on toggle component

Posted: Fri Feb 08, 2013 2:21 pm
by Michael4771079

Thanks Marina,
I tried this on click, no result, is there something you can see thats wrong

code$("mobiletoggle").click(function(){
$(this).toggleText("Yes", "No").next().toggle();
return false;
});/code


Change words on toggle component

Posted: Fri Feb 08, 2013 2:59 pm
by Maryna Brodina

Try this JS:

codeTiggzi("mobiletoggle1").parent().find(".ui-slider-label-a").text("Yes");
Tiggzi("mobiletoggle1").parent().find(".ui-slider-label-b").text("No");/code

mobiletoggle1 - name of toggle component


Change words on toggle component

Posted: Fri Feb 08, 2013 3:40 pm
by Michael4771079

Hi Marina,
I diddn't get it to work

on mobiletoggle1, click event, run js, entered code, no change?


Change words on toggle component

Posted: Fri Feb 08, 2013 3:54 pm
by Kateryna Grynko

Hi Michael, apply code on page load event - this will change text on button when page loads.


Change words on toggle component

Posted: Fri Feb 08, 2013 4:00 pm
by Michael4771079

Thanks Folks


Change words on toggle component

Posted: Tue Apr 30, 2013 5:57 pm
by Andrés Méndez

Hello Katya.

I have added the Event, when my page Load, with action Run Javascript, but it didn't work.

I have tried also changing "mobiletoggle" with the name of my toggle, but also doesn't work.

Maybe it is not compatible with this code of my JSON?
codevar toggleValue = value ? "on" : "off&quot
element.val(toggleValue).refresh();

return true;/code


Change words on toggle component

Posted: Sat May 04, 2013 12:39 am
by maxkatz

Make sure 'element' is actually the right element in the DOM. Then, try setting a static value for the label, to see if that works.


Change words on toggle component

Posted: Sun May 05, 2013 6:05 pm
by Andrés Méndez

Hello Max.

That code is inside a data association from a JSON. If I change "element" for the name of my real element, the entire page fails.