Search
 
SCRIPT & CODE EXAMPLE
 

PHP

toggle switch php

//html
<span id="setQuickVar1">Enable Notifications<input id="QuickVar1" type="checkbox" class="make-switch" data-size="small" data-on-color="success" data-on-text="ON" data-off-color="default" data-off-text="OFF" ></span>
                                  <div id="resultQuickVar1"></div>

//js
$('#setQuickVar1').on('click', function() {
    var checkStatus = this.checked ? 'ON' : 'OFF';

    $.post("quickRightSidebarDBUpdate.php", {"quickVar1a": checkStatus}, 
    function(data) {
        $('#resultQuickVar1').html(data);
    });
});

//php
if (isset($_POST['quickVar1a'])){
    $quickVar1a = $_POST['quickVar1a'];
    $query2 = "UPDATE test SET field1 = '".$quickVar1a."' where field1 != '".$quickVar1a."'";
}
Comment

PREVIOUS NEXT
Code Example
Php :: create qr code png image of 200*200 using phpqrcode 
Php :: Laravel Extract Values From Collection Using Pluck() with Relationship 
Php :: phph call functions from other .php file 
Php :: livewire model bind item in array 
Php :: Csv To AssoT Php 
Php :: doctrine orm refresh 
Php :: php get highest value in multidimensional array 
Php :: how to use or where in laravel 
Php :: php xpath attribute exact 
Php :: laravel map the output of the api 
Php :: php two array difference merge recursive 
Php :: ignore user id on email validation laravel 
Php :: php += 
Php :: php undefined offset 
Php :: Declare A PHP Array 
Php :: avatar generator laravel 
Php :: if user not signed in redirected to login laravel from route 
Php :: php header 
Php :: get the value without setter method laravel 
Php :: php online test 
Php :: php inner join array 
Php :: laravel, if -get() array is not emtpy 
Php :: laravel package console command 
Php :: php spreadsheet styles 
Php :: Laravel how to use @auth and @guest with multi authentication 
Php :: Code for finding Prime Numbers 
Php :: how pass optional route parameter in laravel 
Php :: Call to undefined function array_key_first() 
Php :: link headers disabled wp 
Php :: how to add php to html 
ADD CONTENT
Topic
Content
Source link
Name
8+9 =