asprin
Active member
Hello there,
In a template, if we use
![1663861942266.png 1663861942266.png](https://xenforo.com/community/data/attachments/272/272962-d06c56e07472f3e58e848c2fa7db540c.jpg?hash=0GxW4HRy8-)
Without that attribute or
![1663862022447.png 1663862022447.png](https://xenforo.com/community/data/attachments/272/272963-555f798dcc344e92aef35b2cbd9bdaea.jpg?hash=VV95jcw0Tp)
However, I was wondering if XF allows us to have a the switch UI without having to submit anything to the server. If I use
![1663862133735.png 1663862133735.png](https://xenforo.com/community/data/attachments/272/272964-6fe953c6533db26168d3b4f35835f12a.jpg?hash=b-lTxlM9sm)
Is this possible to achieve? i.e. have the on/off UI but it shouldn't post anything to the server.
In a template, if we use
<xf:toggle submit="true" />
, it gives us a nice little switch on the UI like the following:![1663861942266.png 1663861942266.png](https://xenforo.com/community/data/attachments/272/272962-d06c56e07472f3e58e848c2fa7db540c.jpg?hash=0GxW4HRy8-)
Without that attribute or
submit=""
, it turns into a checkbox which is absolutely fair.![1663862022447.png 1663862022447.png](https://xenforo.com/community/data/attachments/272/272963-555f798dcc344e92aef35b2cbd9bdaea.jpg?hash=VV95jcw0Tp)
However, I was wondering if XF allows us to have a the switch UI without having to submit anything to the server. If I use
submit="true"
but without providing a URL to post, it does the job of turning off and on (along with checking/unchecking the hidden checkbox). However, the browser console will log an error and that is something I don't prefer to see on the client side.![1663862133735.png 1663862133735.png](https://xenforo.com/community/data/attachments/272/272964-6fe953c6533db26168d3b4f35835f12a.jpg?hash=b-lTxlM9sm)
Is this possible to achieve? i.e. have the on/off UI but it shouldn't post anything to the server.