Code: Alles auswählen
<script language="javascript" type="text/javascript">
function switchToOn(status) {
if(status) {
switchToOff(false);
$('on').show();
}else $('on').hide();
}
function switchToOff(status) {
if(status) {
switchToOn(false);
new Ajax.Request('index.php?tab=benutzer&sub_tab=voicemail&request&ext=' + <?= $_GET["show"]; ?>,
{
method : 'get',
onSuccess : function(resp) {
if(resp.responseText != "false") {
alert("Ausgeschaltet");
}else alert("failed");
},
onFailure : function() {
alert('Ajax.Request failed');
},
}
);
$('off').show();
}else $('off').hide();
}
</script>
div code:
Code: Alles auswählen
<div id="on" style="display:<?= ($query['0']['variable']== 1) ? "show": "none"; ?>;">