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

Javascript slowing down page in ie6

1 Answer 65 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Jomey
Top achievements
Rank 1
Jomey asked on 03 Jul 2008, 05:09 PM

I have datepicker user control and run this on load.

In ie6 it loads the page for a couple seconds then it refreshes the page once it finishes loading the javascript.  The below script is run for each calendar.  I have tons of calendars on the page - over 25.

Is there a solution to the page refresh.  In ie7 it doesn't refresh - it just takes longer to load.

string
script = string.Format(@"

var {0}invalidInput = false;

var {0}errmessage = '';

function {0}_ShowDetails()

{{

var pnlName = '{0}_pnlDetails';

var myPanel = document.getElementById(pnlName);

if (myPanel != undefined)

{{

myPanel.style.display='block';

var rfvName = '{0}_rfv';

var ReqValidator = document.getElementById(rfvName);

ValidatorEnable(ReqValidator,true);

}}

}}

function {0}_HideDetails()

{{

var pnlName = '{0}_pnlDetails';

var myPanel = document.getElementById(pnlName);

if (myPanel != undefined)

{{

myPanel.style.display='none';

var rfvName = '{0}_rfv';

var ReqValidator = document.getElementById(rfvName);

ValidatorEnable(ReqValidator,false);

}}

}}

function {0}_OnDateSelected(sender, args)

{{

{0}invalidInput = false;

{0}_ShowDetails();

}}

function {0}_OnError(sender, args)

{{

if (args.get_reason() == Telerik.Web.UI.InputErrorReason.ParseError)

{{

{0}errmessage='Date must be in valid format (mm/dd/yyyy)';

{0}invalidInput = true;

}}

else if (args.get_reason() == Telerik.Web.UI.InputErrorReason.OutOfRange)

{{

{0}errmessage='Date out of range';

{0}invalidInput = true;

}}

alert({0}errmessage);

}}

function {0}_CustomValidate(sender, args)

{{

var customVal = document.all ? document.all['{1}'] : document.getElementById('{1}');

customVal.errormessage = {0}errmessage;

if ({0}invalidInput)

args.IsValid = false;

}}

function {0}_OnBlur(sender, args)

{{

if (sender.GetTextBoxValue() == '')

{{

{0}invalidInput = false;

}}

}}"

, this.ClientID, CustomValidator1.ClientID);

RadDatePicker picker = (RadDatePicker)RadDatePicker1;

RadDatePicker1.DateInput.ClientEvents.OnError =

string.Format("{0}_OnError", this.ClientID);

RadDatePicker1.DateInput.ClientEvents.OnBlur =

string.Format("{0}_OnBlur", this.ClientID);

RadDatePicker1.ClientEvents.OnDateSelected =

string.Format("{0}_OnDateSelected", this.ClientID);

CustomValidator1.ClientValidationFunction =

string.Format("{0}_CustomValidate", this.ClientID);

1 Answer, 1 is accepted

Sort by
0
Pavel
Telerik team
answered on 07 Jul 2008, 12:36 PM
Hello Jomey,

We are not sure what is causing the behavior you are observing. It will be best if you open a support ticket and attach to it a small runnable sample which reproduces the issue. Thus we will examine it an get back to you with our findings.

Best wishes,
Pavel
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Calendar
Asked by
Jomey
Top achievements
Rank 1
Answers by
Pavel
Telerik team
Share this question
or