Posts Tagged Javascript validation

Simple Javascript Validation for Checkbox

There are times when we need to add javascript validation to check if at least one of a group of checkbox options has been checked. Here is a simple function that’ll solve the problem and works in most of the browsers.

<html>
<head>
<title>Imran’s checkbox validation</title>
<script language=”javascript”>
//frm is the form element
function checkForm(frm){
var destCount = frm.elements['dest[]‘].length;
var destSel [...]

4 Comments