Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
125
WebNumericEdit Tooltip via JavaScript
posted

Hi,

I would like to access (set) tooltip text of WebNumericEdit using Javascript.

Is it, and what's interesting me more, how is that possible?

 

Regards

Peter R.

  • 24497
    Suggested Answer
    posted

    Hi Peter,

    The editor has public member variable Element which contains reference to the outer element (it can be INPUT or TABLE depending on buttons).

    So, you may set title attribute for it. You can get reference to editor using igedit_getById(clientID_ofEditor), or using first param in ClientSideEvents. Below is example to set initial tooltip and change it dynamically on value change.

    <script type="text/javascript">
    function WebNumericEdit1_ValueChange(oEdit, oldValue, oEvent)
    {
     oEdit.Element.title = 'value in editor:' + oEdit.getValue();
    }
    function WebNumericEdit1_Initialize(oEdit, oldValue, oEvent)
    {
     oEdit.Element.title = 'my tooltip';
    }
    </script>
    <igtxt:WebNumericEdit ID="WebNumericEdit1" runat="server">
       <ClientSideEvents ValueChange="WebNumericEdit1_ValueChange" Initialize="WebNumericEdit1_Initialize" />
    </igtxt:WebNumericEdit>