Take the 2-minute tour ×
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It's 100% free, no registration required.
<script type="text/javascript"> 
    function chckIsPrivate() 
    { 
    var isprivate = document.getElementById('{!$Component.theForm.searchresults.isprivate}').checked; 
    } 
    </script> 

    <apex:inputCheckbox id="isprivate" onclick="chckIsPrivate()" />

Now I want to pass the "isprivate" value from Javascript to my controller...help me on this ASAP

share|improve this question
    
Why not just bind the checkbox to a property in your controller and save all the JS work? –  Eric Dec 4 '14 at 15:36
    
Could you please share the code? –  Uday Dec 4 '14 at 15:39
1  
Really? Are you saying that you do not know how to bind an <apex:inputCheckbox> to a property in the controller? Suggest you read up on the <apex:inputCheckbox> first and give it a shot –  Eric Dec 4 '14 at 15:51
    
need to pass javascript variable isprivate to controller –  Uday Dec 4 '14 at 16:12
    
Need the Solution a bit urgent... –  Uday Dec 4 '14 at 16:36

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.