Numberformat Javascript Error

4 posts, 0 answers
  1. Greg Duffield
    Greg Duffield avatar
    38 posts
    Member since:
    Feb 2006

    Posted 16 Oct 2008 Link to this post

    I am trying to set the value of a radNumericTextbox using javascript but it errors in the javascript (in the Telerik controls) it seems as though the methods such as Round etc are not being bound to the object.

    I then get an error here:-
    if(!this.get_numberFormat().KeepNotRoundedValue){  
    _49=NumberFormat.Round(_49,this);  



    It seems as though that _49 = 5, NumberFormat is an object but there is no Round Method and so it dies.

    Any ideas on how to resolve this please.

    Many Thanks

    Greg

  2. Daniel
    Admin
    Daniel avatar
    4945 posts

    Posted 16 Oct 2008 Link to this post

    Hello Greg,

    Please show us your RadNumericTextBox declaration and the depicted JavaScript code. This will help us to give you an appropriate answer.

    Regards,
    Daniel
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Greg Duffield
    Greg Duffield avatar
    38 posts
    Member since:
    Feb 2006

    Posted 16 Oct 2008 Link to this post

    The numerictextbox is defined as follows:-
    <telerik:RadNumericTextBox ID="rntRate" runat="server" BackColor="#fffedb" Type="Currency" Font-Bold="true" Culture="en-GB" Width="75px" /> 

    and the javascript using this is
     function SetPalletSpaceValues(combo) {  
                debugger;  
                var item = combo.get_selectedItem();  
                var rntxtPalletSpaces = $find("<%=rntxtPalletSpaces.ClientID%>");  
                var txtNoPallets = $get("<%=txtNoPallets.ClientID%>");  
                var palletSpaceValue = item.get_attributes().getAttribute("PalletSpaceValue");  
                 
                if(palletSpaceValue == "0.25" || palletSpaceValue == "0.50")  
                    rntxtPalletSpaces.set_value(palletSpaceValue);  
                else if(palletSpaceValue == "1.00")  
                    rntxtPalletSpaces.set_value(parseInt(txtNoPallets.value));  
                else 
                    rntxtPalletSpaces.set_value("");  
            } 


    Hope this helps.

    Thanks

    Greg    
  5. Daniel
    Admin
    Daniel avatar
    4945 posts

    Posted 17 Oct 2008 Link to this post

    Hello Greg,

    The code you provided seems to be correct so I suppose the error may be caused due to another reason. Is it possible to send us a simple working copy of your project using regular support ticket?

    Thank you for your cooperation.

    Regards,
    Daniel
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Back to Top