Activity Forums Salesforce® Discussions How to get element id of Salesforce Visualforce Components to be used in Javascript?

  • shariq

    Member
    September 22, 2018 at 5:02 pm

    {!$Component.Parent1.Parent2.fieldId}

  • Parul

    Member
    September 22, 2018 at 6:12 pm

    Created Date: <apex:inputText id="dah" value="{!created}" size="50"
    onclick="javascript:go('{!$Component.dah}')"></apex:inputText>

    <script>
    function go(field) {
    var huh = document.getElementById(field).value;
    alert(huh); //returns the string u put inside of input text field
    }
    </script>

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos