I"m using a toggle switch to replace my select and 2 options code...
The old code had select with name and two options with values of "0" and "1".
How can i define the values of the on \ off buttons in this new code?
For example i want the value of "OFF" to be 0 and "ON" to be 1.
I"m not using ajax, just a regular form.
This is the Toggle Switch Code:
html,
body {
  display: flex;
  min-height: 100%;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  font-family: sans-serif;
}
.tgl {
  display: none;
}
.tgl, .tgl:after, .tgl:before, .tgl *, .tgl *:after, .tgl *:before, .tgl + .tgl-btn {
  box-sizing: border-box;
}
.tgl::-moz-selection, .tgl:after::-moz-selection, .tgl:before::-moz-selection, .tgl *::-moz-selection, .tgl *:after::-moz-selection, .tgl *:before::-moz-selection, .tgl + .tgl-btn::-moz-selection {
  background: none;
}
.tgl::selection, .tgl:after::selection, .tgl:before::selection, .tgl *::selection, .tgl *:after::selection, .tgl *:before::selection, .tgl + .tgl-btn::selection {
  background: none;
}
.tgl + .tgl-btn {
  outline: 0;
  display: block;
  width: 4em;
  height: 2em;
  position: relative;
  cursor: pointer;
  -webkit-user-select: none;
     -moz-user-select: none;
      -ms-user-select: none;
          user-select: none;
}
.tgl + .tgl-btn:after, .tgl + .tgl-btn:before {
  position: relative;
  display: block;
  content: "";
  width: 50%;
  height: 100%;
}
.tgl + .tgl-btn:after {
  right: -50%;
}
.tgl + .tgl-btn:before {
  display: none;
}
.tgl:checked + .tgl-btn:after {
  right: 50%;
}
.tgl-flat + .tgl-btn {
  padding: 2px;
  transition: all .2s ease;
  background: #fff;
  border: 4px solid #f2f2f2;
  border-radius: 2em;
}
.tgl-flat + .tgl-btn:after {
  transition: all .2s ease;
  background: #f2f2f2;
  content: "";
  border-radius: 1em;
}
.tgl-flat:checked + .tgl-btn {
  border: 4px solid #7FC6A6;
}
.tgl-flat:checked + .tgl-btn:after {
  right: 0%;
  background: #7FC6A6;
}<!DOCTYPE html>
<html lang="en" >
<head>
  <meta charset="UTF-8">
  <title>Pure CSS toggle buttons</title>
  <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css"> 
</head>
<body>
    <h4>Toggle Switch</h4>
    <input class="tgl tgl-flat" id="cb4" class="radio" value="1" name="fooby[1][]" type="checkbox" checked />
    <label class="tgl-btn" for="cb4"></label>
</body>
</html>The old code is this:
<select class="select" name="notifications" type="text">
   <option value="1" <? if ($notifications == 1) echo "selected"; ?>>ON</option>
   <option value="0" <? if ($notifications == 0) echo "selected"; ?>>OFF</option>
</select>
 
     
    