This is a migrated thread and some comments may be shown as answers.

Numberformat Javascript Error

3 Answers 36 Views
Input
This is a migrated thread and some comments may be shown as answers.
Greg Duffield
Top achievements
Rank 1
Greg Duffield asked on 16 Oct 2008, 05:04 PM
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

3 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 16 Oct 2008, 05:28 PM
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.
0
Greg Duffield
Top achievements
Rank 1
answered on 16 Oct 2008, 06:28 PM
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    
0
Daniel
Telerik team
answered on 17 Oct 2008, 05:55 PM
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.
Tags
Input
Asked by
Greg Duffield
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Greg Duffield
Top achievements
Rank 1
Share this question
or