Repost: Calendar Issue!

A

Adam Knight

Hi all,

I have a page containing a aspx calendar.
This page appears in a pop up window via a javascript open window command.

What i need to acheive is, once a user has selected a date.
This window is to close and pass back the selected date to the calling page.

In classic asp i would use the following javascript when a user selected a
calendar item to achieve this:
javascript:self.opener.set_date('myFormElement','mydateval');
window.close();

I have tried attaching this to the aspx calendar via the OnDayRender Method;
thus adding the javascript to the calendar cells. But when i select a date
nothing happens.

Any ideas on what i need to do or how i can acheive this with .net?

Any suggestions appreciated!

Cheers,
Adam
 
A

Adam Knight

Hi guys,

Attaching the following code to the OnDayRender method of the Calendar works
fine:

javascript:self.opener.set_date('myFormElement','mydateval');
window.close();

My problem was an oversight; i failed to specify the correct
'myFormElement'.

Here is the javascript function used: (parent window)
// JavaScript Document
function set_date(jsId, date_val) {

var fromEl = document.getElementById(jsId);
fromEl.value = date_val;

}

Cheers,
Adam
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top