Glowworm27
Programmer
I have some Javascript, on an ASP.Net page and I cannot get this script to work.
I am calling it on the html page using this code
basically what I want is to pass the control to the javascript function get the control name (clientid) then display a calender underneath the control on the form.
The error is that RadDateInput1 is Undefined. I cannot understand why the control id is not being passed to the javascript.
I hope you can help
Thanks In Advance.
![[cannon] [cannon] [cannon]](/data/assets/smilies/cannon.gif)
George Oakes
Check out this awsome .Net Resource!
Code:
function ShowCalAll(e, sControlName)
{
if (!e)
e = window.event;
if (!popup)
popup = new RadCalendar.Popup();
//if (!calendarContainer
calendarContainer = document.getElementById("calCheckIn1");
var inputBox = document.getElementByID(sControlName.ClientID +'_textbox');
var x = PositionX(inputBox);
var y = PositionY(inputBox) + inputBox.offsetHeight;
popup.Show(x, y, calendarContainer);
if (e)
{
e.cancelBubble = true;
if (e.preventDefault) e.preventDefault();
}
}
I am calling it on the html page using this code
Code:
<div onclick="ShowCalAll(event, RadDateInput1)">
<radi:RadDateInput id="RadDateInput1" Runat="server" DateFormat="d" Skin="Default" RadCalendarId="calendarCheckIn" RadControlsDir="RadControls/" Width="119px" MinDate="1800-01-01"></radi:RadDateInput>
</div>
basically what I want is to pass the control to the javascript function get the control name (clientid) then display a calender underneath the control on the form.
The error is that RadDateInput1 is Undefined. I cannot understand why the control id is not being passed to the javascript.
I hope you can help
Thanks In Advance.
![[cannon] [cannon] [cannon]](/data/assets/smilies/cannon.gif)
George Oakes
Check out this awsome .Net Resource!