title: Define the values of the ON and OFF toggle buttons
body: <p>I"m using a toggle switch to replace my select and 2 options code...</p>
  
  <p>The old code had select with name and two options with values of "0" and "1".</p>
  
  <p>How can i define the values of the on \ off buttons in this new code?</p>
  
  <p>For example i want the value of "OFF" to be 0 and "ON" to be 1.</p>
  
  <p>I"m not using ajax, just a regular form.</p>
  
  <p>This is the Toggle Switch Code: </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-css lang-css prettyprint-override"><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;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt;
  &lt;html lang="en" &gt;
  
  &lt;head&gt;
    &lt;meta charset="UTF-8"&gt;
    &lt;title&gt;Pure CSS toggle buttons&lt;/title&gt;
    &lt;meta name="viewport" content="width=device-width, initial-scale=1"&gt;
      &lt;link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css"&gt; 
  
  &lt;/head&gt;
  &lt;body&gt;
      &lt;h4&gt;Toggle Switch&lt;/h4&gt;
      &lt;input class="tgl tgl-flat" id="cb4" class="radio" value="1" name="fooby[1][]" type="checkbox" checked /&gt;
      &lt;label class="tgl-btn" for="cb4"&gt;&lt;/label&gt;
  &lt;/body&gt;
  
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>The old code is this: </p>
  
  <pre><code>&lt;select class="select" name="notifications" type="text"&gt;
     &lt;option value="1" &lt;? if ($notifications == 1) echo "selected"; ?&gt;&gt;ON&lt;/option&gt;
     &lt;option value="0" &lt;? if ($notifications == 0) echo "selected"; ?&gt;&gt;OFF&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>