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

How to get the values to pass form inputtext to javascript

 <apex:pageblock id="pb1">
            <apex:pageblockSection id="pbs1">
                <apex:inputCheckbox id="checkbox1" label="Check Me" onclick="getCheckBoxValue();"></apex:inputCheckbox>
                <apex:inputtext id="textbox1" label="Name" onchange="gettexBoxValue();"/>
    <script language="javascript">
        function getCheckBoxValue()
         function gettexBoxValue()
           var a=document.getElementById('{!$Component.frm1.pb1.pbs1.textbox1}');
       //if iam using this iam getting.  
        function CopySubject() {
      var CaseSub= $('[id$=textbox1]').val();
Sahil ShitoleSahil Shitole
Hi Deepika,

You can use class attribute instead of Id to get the value.

 <apex:inputtext styleClass="textbox1" label="Name" onchange="gettexBoxValue();"/>

In the JS you use: