Reputation: 39
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>';
Upvotes: 0
Views: 120
Reputation: 1
The first role you need it, set it and after using that, change role with JavaScript or jQuery and use the second role.
Upvotes: -1