datalist edit mode and javascript pop up calendar

  • Thread starter Thread starter Ravikanth[MVP]
  • Start date Start date
R

Ravikanth[MVP]

Hi

Check whether textbox control name is 'txtDischargeDate'
or it contains automatically generated id?

HTH
Ravikanth
 
The control name is 'txtDischargeDate' and it is automatically created when
in edit mode. How can I reference it in Javascript?

Buran

Ravikanth said:
Hi

Check whether textbox control name is 'txtDischargeDate'
or it contains automatically generated id?

HTH
Ravikanth

-----Original Message-----
Dear ASP.NET Programmers,

I am using a javascript to display popup calendar and return the selected
date to the control in the calling form. No problems here. When I use this
script for a control that is created in datalist edit mode, the popup
calendar doesn't return the date because it cannot find the control (or I
think so). Is there any way to work around this? I use the following code:

<script language="Javascript">
function GetDate(ctrlName)
{
childWindow = window.open('popup.aspx?formName=' +
document.forms[0].name + '&ctrlName=' + ctrlName, "PopUpCalendar",
"width=350, height=230, top=200, left=200, toolbars=no, scrollbars=no,
status=no, resizable=no");
}

function CloseWindow()
{
childWindow.close()
}
</script>
<script language="JavaScript">

<A href="javascript:GetDate('txtDischargeDate')"><IMG
src="images/smallcalendar.gif" border="0"></A>

Thanks in advance,

Buran


.
 
The control name is txtDischargeDate. No problems there. Any suggestions?

Buran

Ravikanth said:
Hi

Check whether textbox control name is 'txtDischargeDate'
or it contains automatically generated id?

HTH
Ravikanth

-----Original Message-----
Dear ASP.NET Programmers,

I am using a javascript to display popup calendar and return the selected
date to the control in the calling form. No problems here. When I use this
script for a control that is created in datalist edit mode, the popup
calendar doesn't return the date because it cannot find the control (or I
think so). Is there any way to work around this? I use the following code:

<script language="Javascript">
function GetDate(ctrlName)
{
childWindow = window.open('popup.aspx?formName=' +
document.forms[0].name + '&ctrlName=' + ctrlName, "PopUpCalendar",
"width=350, height=230, top=200, left=200, toolbars=no, scrollbars=no,
status=no, resizable=no");
}

function CloseWindow()
{
childWindow.close()
}
</script>
<script language="JavaScript">

<A href="javascript:GetDate('txtDischargeDate')"><IMG
src="images/smallcalendar.gif" border="0"></A>

Thanks in advance,

Buran


.
 
Back
Top