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

Culture Error

1 Answer 24 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Josh Coffield
Top achievements
Rank 1
Josh Coffield asked on 13 Oct 2009, 04:56 AM
I am having a problem with date formats.  I am adding a date picker in my code behind.  When I select the date, it appears in the correct format in the textbox (10/19/2009) but when I retrieve the value through javascript it shows it in another format (2009-10-22). 

The code to add the date picker appears below.

            RadDatePicker dPick = new RadDatePicker();
            dPick.ID = "DateField1";
            dPick.Culture = CultureInfo.GetCultureInfo("en-US");
            plcForm.Controls.Add(dPick);

The javascript code I use to retrieve the value appears below:

        function TestForm()
        {
            alert(document.forms[0].DateField1.value);
        }

Am I setting the culture format incorrectly?



1 Answer, 1 is accepted

Sort by
0
robertw102
Top achievements
Rank 1
answered on 15 Oct 2009, 03:12 PM
I believe the issue has to do with the way your retrieving the value in your javascript function.

Here's one of the Telerik help topics that I think might be of use:


Hopefully that helps.
Tags
Calendar
Asked by
Josh Coffield
Top achievements
Rank 1
Answers by
robertw102
Top achievements
Rank 1
Share this question
or