<html>
  <head>
  <script defer src="https://cdn.formli.com/html-forms/os-forms-v1.min.js?workspace-id=1745"></script>
  <script defer src="https://cdn.formli.com/elements/os-custom-elements-v1.min.js?workspace-id=1745"></script>
  </head>
  <body>
  <div class="relative">
  <form data-os-uuid="ax4z72pw15" data-os-element="form" action="https://app.formli.com/api/v1/data_responses" method="post">
    <h3>MC Checkboxes</h3>
    <div>
      <div data-os-element="multiple-choice" data-os-uuid="dfke3278vk4">
      	<input
          id="mo21ploome8"
          data-os-element="option"
          type="checkbox"
          data-os-uuid="mo21ploome8"
         />
         <label for="mo21ploome8">Weekly</label>
        <input
          id="moy1079934r"
          data-os-element="option"
          type="checkbox"
          data-os-uuid="moy1079934r"
         />
         <label for="moy1079934r">Bi-weekly</label>
          <input
            id="moqedg88meo"
            data-os-element="option"
            type="checkbox"
            data-os-uuid="moqedg88meo"
           />
         <label for="moqedg88meo">Monthly</label>
      </div>
      <div data-os-element="field-error" data-os-for="dfke3278vk4" class="os-hidden"></div>
    </div>
    <input type="submit" value="Submit" data-os-wait="Please wait..." />
  </form>
  <div class="os-hidden" data-os-element="form-success">
    <div>Thank you! Your submission has been received!</div>
  </div>
  <div class="os-hidden" data-os-element="form-error">
    <div>Oops! Something went wrong while submitting the form.</div>
  </div>
</div>
  </body>
</html>
body {
  font-family: 'Arial', sans-serif;
  background-color: #000; /* Dark background */
  color: #fff; /* White text for contrast */
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  margin: 0;
}

form {
  background-color: #333; /* Dark form background */
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.5);
  width: 300px;
  border: 6px solid transparent;
}

h3 {
  color: #fff;
  text-align: center;
}

label {
  display: block;
  margin-bottom: 10px;
}

input[type="text"] {
  width: 290px;
  height: 35px;
  border: 5px solid grey;
}

input[type="text"].field-loading {
  border-color: orange;
}

input[type="submit"] {
  background: linear-gradient(45deg, #FFC107, #FF5722); /* Gradient button */
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 4px;
  cursor: pointer;
  width: 100%;
  transition: background-color 0.3s;
}

input[type="submit"]:hover {
  background: linear-gradient(45deg, #FF9800, #F44336); /* Darker gradient on hover */
}

form > div {
  margin-bottom: 15px;
}

.flex {
  display: flex;
  gap: 10px;
  align-items: center;
}

.absolute {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.relative {
  position: relative;
}

.cover {
  width: 100%;
  height: 100%;
  background: black;
  opacity: 0.5;
}

.form-loading {
  border: 6px solid orange;
  opacity: 0.5;
}

.field-error {
  border-color: red !important;
}

input[type="checkbox"] {
  display: none;
}

input[type="checkbox"] + label {
  display: block;
  align-items: center;
  padding: 10px 20px;
  border: 2px solid #fff;
  border-radius: 4px;
  cursor: pointer;
  color: #fff;
  background-color: #444; /* Dark background for unselected state */
  transition: background-color 0.3s, color 0.3s;
  margin-right: 10px;
  position: relative; /* Needed for checkmark positioning */
}

input[type="checkbox"] + label::before {
  content: '';
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-right: 10px;
  border: 2px solid #fff;
  border-radius: 4px; /* Rounded corners for checkbox */
  background-color: transparent;
  transition: background-color 0.3s, border-color 0.3s;
  position: relative;
  box-sizing: border-box;
}

input[type="checkbox"]:checked + label::before {
  background-color: #4CAF50; /* Green fill color for selected state */
  border-color: #4CAF50;
}

input[type="checkbox"]:checked + label::after {
  content: '✓'; /* Check mark for selected state */
  position: absolute;
  left: 24px;
  top: calc(50% - 9px);
  color: #fff; /* Check mark color */
  font-size: 12px;
}

input[type="checkbox"] + label:hover {
  background-color: #555; /* Slightly lighter background on hover */
}

input[type="checkbox"]:checked + label:hover {
  background-color: #45A049; /* Slightly darker green on hover */
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.