lundi 19 mars 2018

Ace-switch checkbox onclick event

I have this checkbox:

enter image description here

This is code for checkbox:

<input class="ace ace-switch" data-toggle="tooltip" data-placement="top" value="true" type="checkbox" id="checkBoxId" onclick="switch();" >

On click i want change href(url) and based on that url i hide/show some other element on page.

This is code for onclick event:

<script type="text/javascript">
function switch() {
    location.href="../../app/?viewMode=<%= viewMode.equals("presentation")?"full":"presentation" %>"
}

On click href(url) is changed and elements is hide or show but switch image always stay off. enter image description hereenter image description here

enter image description hereenter image description here

Why?




Aucun commentaire:

Enregistrer un commentaire