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

get_value ok in IE not in Chrome & Firefox

2 Answers 20 Views
Slider
This is a migrated thread and some comments may be shown as answers.
Herve
Top achievements
Rank 2
Herve asked on 05 Nov 2012, 12:50 AM
Hi,

The following function is working fine in IE but the sliders are not displayed in Chrome or Firefox.

If I replace "var MyAmount = slider1.get_value();" by "var MyAmount = "1000" and the same for "var MyDuration" all is perfect.
Is it a known issue ?

Any idea about how to fix that problem to make it works in all the browsers ?

Thanks for your support ...

Herve

function RefundRange() {

        var slider1 = $find('<%= RsAmount.ClientID %>');
        var MyAmount = slider1.get_value();

        var slider2 = $find('<%= RsDuration.ClientID %>');
        var MyDuration = slider2.get_value();
       
        var MiniRefund = Math.round((((MyAmount * 7) / 100) + MyAmount) / MyDuration);
        var MaxiRefund = Math.round((((MyAmount * 14) / 100) + MyAmount) / MyDuration);


        SpanMiniRefund.innerHTML = "CHF " + MiniRefund + ".-";
        SpanMaxiRefund.innerHTML = "CHF " + MaxiRefund + ".-";
}

        
        

2 Answers, 1 is accepted

Sort by
0
Accepted
Slav
Telerik team
answered on 06 Nov 2012, 09:35 AM
Hello Herve,

Possible problems that could occur when using the code you posted are:
  • The value of MyDuration is zero which results in division by zero. You should check for this case, if you have not done this already.
  • You are calling the function RefundRange before the client-side objects of the RadSliders are created. Sys.Application.load Event is the earliest event in which is recommended to call your function.

The sliders not being displayed suggest a JavaScript error that prevents their client-side objects from being created, however I cannot determine the exact cause for this from your sample. I need to examine the setup of the sliders, as well as the script in which you call the function RefundRange in order to provide a more to the point answer. A simple, runnable project that isolates the problem will be useful for inspecting it locally. You can send it by opening a regular support ticket.


Greetings,
Slav
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Herve
Top achievements
Rank 2
answered on 06 Nov 2012, 11:41 AM
Hi,

Thanks for your reply.

I was tried to make a little sample site as per suggested and all is working in all the browser when I'm not using a master page.

I'm sending the whole project because I'm not able to reproduce it.

Best regards,


Herve
Tags
Slider
Asked by
Herve
Top achievements
Rank 2
Answers by
Slav
Telerik team
Herve
Top achievements
Rank 2
Share this question
or