One of my colleagues has written a calendar picker function and it is popping up the calendar in the top left of the screen. He has gone on vacation and I have been asked to reposition it beneath the field the date will be displayed in. Can someone please tell me how to get the X and Y coordinates of a field on a web form?
To position it on the cursor I am using the following:
ScriptManager.RegisterClientScriptBlock(this, typeof(controls_DatePicker), ClientID + "_onPickerChange",
string.Format(@"function {2}_onPickerChange(){{
{0}.SetSelectedDate({1}.GetSelectedDate());
{0}.Show(event.clientX, event.clientY);}}", ClientID, Picker.ClientID, Calendar.ClientID), true);
Many thanks
To position it on the cursor I am using the following:
ScriptManager.RegisterClientScriptBlock(this, typeof(controls_DatePicker), ClientID + "_onPickerChange",
string.Format(@"function {2}_onPickerChange(){{
{0}.SetSelectedDate({1}.GetSelectedDate());
{0}.Show(event.clientX, event.clientY);}}", ClientID, Picker.ClientID, Calendar.ClientID), true);
Many thanks