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
180
How to find a webcurrencyedit in WebdialogWindow
posted

Greetings,

I have a webcurrencyedit control inside of a webdialogwindow.  I have some code that sets decimal places (banking software, it has to act like an adding machine - 600 would be 6.00).  The code works fine on a control outside of the webdialogwindow.  But on the control inside the webdialogwindow, it breaks.  It can't find the webcurrencyedit.

 My webcurrencyedit is named 'newDepositAmount'

I have tried the following, all unsuccessfully:

var DepositAmount = $find(newDepositAmount).innerText;

var DepositAmount = $find<%= newDepositAmount.ClientID %>").innerText;

var DepositAmount = document.getElementById"<%= lblValidation.ClientID %>).innerText

 I need to get the text and then modify it and then reset it to the new value.

 Please advise.

Parents
No Data
Reply
  • 24497
    posted

    Hi,

    If you use WebCurrencyEdit control, then you should use only objects of that control. Below is example:

    <script type="text/javascript">
    function
    click1()
    {
     
    var clientID = "<%=WebCurrencyEdit1.ClientID%>";
     
    // or if you know exact value of WebCurrencyEdit1.ClientID,
     
    // then you may use explicit value
     
    var curr = igedit_getById(clientID);
     
    if(curr)
       curr.setValue(123.45);
    }
    </script>

    <asp:ScriptManager runat="server" ID="ScriptManager1" />
    <
    ig:WebDialogWindow ID="WebDialogWindow1" runat="server">
     
    <ContentPane>
     
    <Template>
        
    <igtxt:WebCurrencyEdit ID="WebCurrencyEdit1" runat="server"></igtxt:WebCurrencyEdit>
        
    <input ID="Button2" type="button" value="button" onclick="click1()" />
      
    </Template>
     
    </ContentPane>
    </
    ig:WebDialogWindow>

Children