Welcome Guest Search | Active Topics | Sign In | Register

DatePicker - Problem in Setting SelectedDate using JavaScipt Options
Varun Paval
Posted: Wednesday, May 21, 2008 12:02:47 AM
Rank: Member
Groups: Member

Joined: 5/20/2008
Posts: 11
Hi,

I have a Datepicker in my .aspx page and i want to set the selected date of the datepicker control in a client side javascript function. but it didn't work. I am giving below the code i have used to do this.


<script language="javascript" type="text/javascript">
function setPickerDate(npDate)
{
//npDate is a date object passed to this function
var newPDate=npDate;
var calSObj=eo_GetObject("dtpStart");
calSObj.setSelectedDate(npDate);
}
</script>

Script executes with no errors. but date does not change in the picker control.

please help me.
eo_support
Posted: Wednesday, May 21, 2008 8:47:58 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,096
Hi,

Your code looks fine. Do you have the page online? If you can post it online we will be happy to take a look and see what we can find.

Thanks
Varun Paval
Posted: Friday, May 23, 2008 11:36:16 PM
Rank: Member
Groups: Member

Joined: 5/20/2008
Posts: 11
Hi eo_support,

I dont have the page online, as the application is under development.

<script language="javascript" type="text/javascript">
function setPickerDate(dtpid)
{
alert(eo_GetObject(dtpid).getSelectedDate()); // works fine. it shows the current selected date
var sDate=eo_StringToDate("2007-01-01"); // no error
alert(sDate); // workd fine.. alerts the date
eo_GetObject(dtpid).goTo(sDate); // it didn't work. it didn't go to the month jan-2007
eo_GetObject(dtpid).setSelectedDate(sDate); // :(
alert(eo_GetObject(dtpid).getSelectedDate()); // No change in selected date.
}
</script>

i am giving you another block of code

<script language="javascript" type="text/javascript">
function setPickerDate(dtpid)
{
alert(eo_GetObject(dtpid).getSelectedDate()); // works fine. it shows the current selected date
eo_GetObject(dtpid).setSelectedDate(null); // ok. cleared the selected date
var sDate=eo_StringToDate("2007-01-01"); // no error
alert(sDate); // workd fine.. alerts the date
eo_GetObject(dtpid).goTo(sDate); // it worked. it went to the month jan-2007
eo_GetObject(dtpid).setSelectedDate(sDate); // :(
alert(eo_GetObject(dtpid).getSelectedDate()); // No change in selected date. (null date)
}
</script>


dtpid - is the ClientId of the server side datepicker control

Can u infer anything from the above?. if u can help me please do it ASAP.

thanking you
have a nice day


Varun Paval

eo_support
Posted: Saturday, May 24, 2008 8:31:03 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,096
Hi,

We tested your code with the latest version and it works fine. Our steps are:

1. Create a new web form;
2. Drop a DatePicker control in the page;
3. Copy JavaScript function setPickerDate into the page;
4. Add the following HTML block into the page:

<div onclick="setPickerDate('DatePicker1');">test</div>

5. Run the page and click "test". The DatePicker goes to 1/1/2007.

Please check the version of your controls and update to the latest version first. You can then try the same steps we tried and see if it works. If the problem persists, you will need to show us the problem either by posting the page online, show the problem on your machine through a web meeting (we can set up the meeting), or create a reproducing VS project and send it to us. Once we can see the problem it should be easy to find out the root cause.

Thanks
Varun Paval
Posted: Wednesday, May 28, 2008 2:01:32 AM
Rank: Member
Groups: Member

Joined: 5/20/2008
Posts: 11
Hi,

I first thank eo_support team for their valuable support. I downloaded the latest version of the control (5.0.51.2). Now my scrpts are working fine. Thanks !

But i get a require licence messege on top of the page. I have purchased one license from you and I am using the same license file that i used with the previous version (4.0.8.2). should make any changes in the license file (eo_web.licx) ?

please reply me ASAP.

regards,

Varun

eo_support
Posted: Wednesday, May 28, 2008 4:06:32 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,096


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.