Change words on toggle component
Hi,
can I change the text on the toggle component from on, off, to yes and no
Catch up wih the Appery.io community on our forum. Here you'll find information on the lastest questions and issues Appery.io developers are discussing.
https://forum.appery.io/
Hi,
can I change the text on the toggle component from on, off, to yes and no
Hello! Yes, you can do that using JS
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
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
Hi Marina,
I diddn't get it to work
on mobiletoggle1, click event, run js, entered code, no change?
Hi Michael, apply code on page load event - this will change text on button when page loads.
Thanks Folks
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"
element.val(toggleValue).refresh();
return true;/code
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.
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.