1. Copy the coding into the HEAD of your HTML document
2. Add the last code into the BODY of your HTML document -->
<!-- STEP ONE: Paste this code into the HEAD of your HTML document -->
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!-- Original: Ronnie T. Moore -->
<!-- Web Site: Free Script And Source Code For Webmaster ,ASP,HTML,VB,Java, Java Script, Dhtml,xml,ajax,programming -->
<!-- Modified by Ronnie T. Moore (Free Script And Source Code For Webmaster ,ASP,HTML,VB,Java, Java Script, Dhtml,xml,ajax,programming) -->
<! >
<! >
<!-- Begin
function countChoices(obj) {
max = 2; // max. number allowed at a time
box1 = obj.form.box1.checked; // your checkboxes here
box2 = obj.form.box2.checked;
box3 = obj.form.box3.checked; // add more if necessary
count = (box1 ? 1 : 0) + (box2 ? 1 : 0) + (box3 ? 1 : 0);
// If you have more checkboxes on your form
// add more (box_ ? 1 : 0) 's separated by '+'
if (count > max) {
alert("Oops! You can only choose up to " + max + " choices! \nUncheck an option if you want to pick another.");
obj.checked = false;
}
}
// End -->
</script>
</HEAD>
<!-- STEP TWO: Copy this code into the BODY of your HTML document -->