This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!

Checkbox form validation in Firefox

By: a guest on Feb 27th, 2012  |  syntax: None  |  size: 0.12 KB  |  views: 27  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. var isChecked = document.forms['myform'].elements['mycheckbox'].checked;
  2. if (!isChecked) {
  3.   alert('You must agree');
  4. }
clone this paste RAW Paste Data