Search code examples
twitter-bootstrapbootstrap-switch

How to set data-off message as blank instead of "off", in bootstrap switch?


Below is the code snippet of my bootstarp toggle button. Here I have set the data-off as blank string although its showing message as off. How can I set it as blank string ?

<input type="checkbox" checked name="CPSoutfrtuc2-chk" value="1" id="CPSoutfrtuc2-chk" data-style="wmwa" data-toggle="toggle" data-on="PO" data-off="" data-size="mini">

Solution

  • To do that I have set data-off = "&nbsp;" instead of blank string and its working. May be it will helpful to someone else also. Below is the code snippet.

    <input type="checkbox" checked name="CPSoutfrtuc2-chk" value="1" id="CPSoutfrtuc2-chk" data-style="wmwa" data-toggle="toggle" data-on="PO" data-off="&nbsp;" data-size="mini">