Hi.. I have a JSP file which connects to DB and dispaly in aTable format by putting a checkbox as a first column of every row dispay. I am giving a name to every checkbox but its not a static name , its a name given dynamically by incrementing a varible in the process of looping(while)The checkbox names are chbF0,chbF1,chbF2,.......
As the browser won't send the checkbox stauts which is not checked(for that it is throw NullPointerException,i verified), I m using hidden filelds. i m giving the name to them as chbSetState0,chbSetState1,chbSetState2,.... i m giving Initial values for these are as 0(zeroes).
I m going to set corresponding hidden value to 1,when the user clicks a checkbox. For that i m calling the function .. setState(). To set a hidden value to 1, i have to get the index name of the checkbox that the user checked,that means i have to append that index value(index_chbSelected) to the hidden field name in this way.... // getting the index of check box clicked var index_chbSelected=window.event.srcElement.name.charAt(4);
// setting the corresponding hidden value (chbSetState+index_chbSelected).value=1;
The logic i written is to know the other page(jsp page will get the hidden field values.If a hidden field value is 1,it treats check box selected)get checkbox state in the current jsp page.
I tried so much to get solution for this.
If any one understood my problem, pls help me to solve this problem. [ July 29, 2006: Message edited by: Bear Bibeault ]