English
<!--Add the following code to the <body> area--> <SCRIPT LANGUAGE="JavaScript"> <!--// function countChoices(obj) { max = 2; box1 = obj.form.box1.checked; box2 = obj.form.box2.checked; box3 = obj.form.box3.checked; count = (box1 ? 1 : 0) + (box2 ? 1 : 0) + (box3 ? 1 : 0); if (count > max) { alert("Sorry, you can only select " + max + " items!"); obj.checked = false; } } //--> </script> <form name="form"> Please maximum Select 2 items: <p> <input type=checkbox name=box1 onClick="countChoices(this)"> Select item 1 <p> <input type=checkbox name=box2 onClick="countChoices(this)"> Select item 2 <p> <input type=checkbox name=box3 onClick="countChoices(this)"> Select item 3 <p> </form>