Two Data types or role on one input

120 views Asked by At

I want to implement cookies on an input, in order for it to work, I need to use data-type="date". The problem is I am using jquery to design a toggle button and they use data-role="flipswitch". Is there a way that I can have two types or roles so that I can retrieve cookies and still use the Jquery library to get the styling?

'<form> \
                         <label for="togggle_test"></label>\
                         <span class="off">testOne</span>\
                        <input id="togggle_test" <?php echo (isset($_COOKIE['userChoice']) && !empty($_COOKIE['userChoice'] ) && ($_COOKIE['userChoice'])== "TEST") ? "checked" : "";?>  onchange="performToggleAction(this)" data-type="date" type="checkbox"></input>\
                    <span class="on"> testTwo  </span>\
                </form>';
1

There are 1 answers

2
Javad Karimi On

The first role you need it, set it and after using that, change role with JavaScript or jQuery and use the second role.