Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting the value of a textbox in the edititem part of a Gridview

Status
Not open for further replies.

monkeymagic2222

Technical User
May 13, 2002
78
GB
Hi,

First of all, apologies if this would be best suited to a Javascript forum.

I have some code that uses a pop up calendar to select a date. Once the date is selected it passes back to the specified text box on the form. This works fine on all my pages except when I use it in the editItem part of a Gridview. All I want to know is what I need to add to the following statement so I can get the value from the row I am currently editing, I know each row has it's own unique ID so the GridView1$txtStartDate will not work:

<asp:TextBox ID="txtStartDate" runat="server" Text='<%# Bind("start_date") %>'></asp:TextBox><a href="javascript:GetDate('Gridview1$txtStartDate')"><img alt="PopUp Calendar" src="SmallCalendar.gif" /></a>

If you need to see the GetDate function, it's:

<script type="text/javascript" language="Javascript">
function GetDate(CtrlName)
{
ChildWindow = window.open('Calendar.aspx?FormName=' + document.forms[0].name + '&CtrlName=' + CtrlName, "PopUpCalendar", "width=270,height=300,top=200,left=200,toolbars=no,scrollbars=no,status=no,resizable=no");
}
function CheckWindow()
{
ChildWindow.close();
}

</script>

I've seen a lot of stuff about similar sorts of problems but they all seem a bit complex for what I'm trying to achieve.

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top