function ccbox()
{
var n = 0;
var checked = false;
for(var i=0; i< document.SecuredClientForm.elements.length; i++)
{
var e = document.SecuredClientForm.elements[i];
if( e.name == 'cbox' && e.checked == true )
{
n++;
}
}
if(n == 0)
{
alert("at least one, please");
}
else
{
return true;
}
/*form的名稱為SecuredClientForm,
checkbox的屬性加上onBlur="ccbox()" --> 移開的時候觸發 */
References:
[1]http://www.blueshop.com.tw/board/FUM20041006152641OLG/BRD20050320125232FY3.html
[2]javascript教室 http://alfu.csie.vnu.edu.tw/webdesign/javascript/js_basic.htm