Results 1 to 3 of 3

Thread: Attributes in Grid- Urgent!

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member jeba's Avatar
    Join Date
    Feb 2000
    Posts
    265

    Attributes in Grid- Urgent!

    Hi there!
    I am using a datagrid with editlinkbutton. So when you edit a row, the values are displayed in textboxes for editing.
    Now I want to run some client side Javascript code on a particular textbox. For ex, when you click on a textbox,
    I want to show a datepicker by passing the next textbox value also.

    Code:
    <asp:TemplateColumn HeaderText="From Date">
         <ItemTemplate>
                   <asp:Label width="80px" ID="lblfdate" runat="server" Text='<%# ConvertDate(DataBinder.Eval(Container.DataItem, "fromdate")) %>' />
        </ItemTemplate>
        <EditItemTemplate>
                 <asp:TextBox width="80px" readonly="true" onclick="ShowDpicker(this,popCal,100,200,'1/Jan/1950',txtTdate.value)"                 runat="server" id="txtfdate" Text='<%# DataBinder.Eval(Container.DataItem, "fromdate") %>' />
        </EditItemTemplate>
    </asp:TemplateColumn>
    <asp:TemplateColumn HeaderText="To Date">
             <ItemTemplate>
                 <asp:Label width="80px" ID="lblTdate" readonly="true" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "Todate") %>' />
                 </ItemTemplate>
                <EditItemTemplate>
                        <asp:TextBox width="80px" runat="server" id="txtTdate" Text='<%# DataBinder.Eval(Container.DataItem, "Todate") %>' />
                 </EditItemTemplate>
     </asp:TemplateColumn>
    When I click on the 'txtfdate', I am getting a client side error saying, 'txtTdate' is not declared.
    I understand that ASP.NET engine creates names for the controls
    in the datagrid at the runtime and send it to the browser.
    My question is, how do I pass the 'txtTdate' in the 'ShowDatepicker' function of 'txtfdate'?

    Can you please help me?
    Last edited by jeba; Oct 11th, 2002 at 02:57 AM.
    J£ßä

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width