function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
SubhamSubham 

Incorrect Length of checkbox displayed

Hi,

 

In  a VF Component , i am having 10 row of record and corresponding to each row i have a checkbox

 so to get the value of no of checkbox checked

i m calling a Java Script function

say

 

CHECKBOX(){

in which a variable

length = $j("input:checked").length // $j is defined on top as var $j = jquery.noConflict();

}

this JS function is called when

<apex:inputCheckbox rendered="Something" id="SOmething" onclick="CHECKBOX()" />

 

this works fine and gives me correct length

but recently one more checkbox outside PageBlocktable is added on which no function is called.

 

but when i check that new checkbox it added to the value of Length variable which is not the desired scenario.

i have a feeling that it might be because of  both checkbox being <apex:inputCheckbox type...

but i am not sure.

 

Please Help

 

Regards,

 

Subham

 

 

Navatar_DbSupNavatar_DbSup

Hi,


I think the region is that VF page component is rendering in html component so when you are clicking on the new outside checkbox of the PageBlocktable your length variable in JavaScript increment

 

Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved. 

 

SubhamSubham

ya i get it , so question is how can i stop this. can i stop rendering in to HTML?

Or can i query  the length by ID of the checkbox within the table?

or what???