With my brain damage, I stayed up till 2.00 am plus because I cannot find it in Google.Surely got somewhere in Google but maybe I didn't type the correct keywords.
So at last, after trying and modifying then I got the result.If you find it useful then, enjoy !
function checkGroup(str,field) { var fieldid; var criteria; var checkedValue=str.checked str=str.value; /*this gets the information we want to evaluate,i put substring because I name the checkbox with the group id and follow by increment_number for example 44411000-111888-1_1. The first 17 character is group id, so i use this group id to identify which group the checkbox fall into */ criteria = str.substring(0,17); for (i=0; i<field.length; i++) { fieldid = field[i].value; if (fieldid.substring(0,17)==criteria) { field[i].checked = checkedValue; } } }//checkGroupClaim
It called by:
<html:checkbox name="myForm" property="strCheck" value="<%=strIndex1.toString()%>" id="<%=strIndex1.toString()%>" onClick="checkGroup(this,document.myForm.strCheck)"/>
No comments:
Post a Comment