Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# ASP.NET Javascript
haiii.....
 
I have static dropdown ,I need to change the value of drop down on text change event .The textbox(textPaid) and the drop down(ddlPaymentStatus) are placed inside a grid. So please give a javascript solution to handle this..

plz ..its urgent..
 
here is my souce code of grid... plz refer the source code ..and give a javascript ..
 

 
<asp:GridView ID="gvCollect" runat="server" AutoGenerateColumns="False" CssClass="gridview"
                            OnRowCancelingEdit="gvCollect_RowCancelingEdit" OnRowDataBound="gvCollect_RowDataBound"
                            OnRowEditing="gvCollect_RowEditing" OnRowUpdating="gvCollect_RowUpdating">
                            <Columns>
                                <asp:TemplateField HeaderText="Apartment No.">
                                    <ItemTemplate>
                                        <asp:Label ID="lblAprtmnt" runat="server" Text='<%# Bind("ApartmentCode") %>' />
                                    </ItemTemplate>
                                    <HeaderStyle CssClass="edit" />
                                    <ItemStyle CssClass="edit" />
                                    <HeaderStyle Font-Bold="True" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Payment Amount (<b>&#2352</b>)">
                                    <ItemTemplate>
                                        <asp:Label ID="LblAmt" runat="server" Text='<%# Bind("TotalAmount")  %>' attr-identity="TotalAmount" />
                                        <asp:HiddenField ID="hidAmt" runat="server" Value='<%# Bind("TotalAmount")  %>' />
                                    </ItemTemplate>
                                    <HeaderStyle CssClass="edit" />
                                    <ItemStyle CssClass="edit" />
                                    <HeaderStyle Font-Bold="True" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Paid Amount (<b>&#2352</b>)">
                                    <ItemTemplate>
                                      <asp:TextBox ID="textPaid" runat="server" onkeypress="return NumberKeyAndDotKey(this.value,event);"
                                            ondragover="return false" autocomplete="off" onpaste="return false" attr-identity="PaidAmount"
                                            Text='<%# Bind("PaidAmt") %>' MaxLength="10" CssClass="textboxForBill1"></asp:TextBox>
                                              <asp:RequiredFieldValidator ID="rfvPaidAmt" runat="server" Visible="true"
                                            ControlToValidate="textPaid" ErrorMessage="*" SetFocusOnError="True"></asp:RequiredFieldValidator>
                                    </ItemTemplate>
                                    <HeaderStyle CssClass="edit" />
                                    <ItemStyle CssClass="edit" />
                                    <HeaderStyle Font-Bold="True" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Additional Balance (<b>&#2352</b>)">
                                    <ItemTemplate>
                                        <asp:TextBox ID="textBalance" runat="server" onkeypress="return NumberKeyAndDotKey(this.value,event);"
                                         Enabled="false"   ondragover="return false" autocomplete="off" onpaste="return false" Text='<%# Bind("Balance") %>'
                                            MaxLength="10" CssClass="textboxForBill"></asp:TextBox>
 
                                    </ItemTemplate>
                                    <HeaderStyle CssClass="edit" />
                                    <ItemStyle CssClass="edit" />
                                    <HeaderStyle Font-Bold="True" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Penalty (<b>&#2352</b>)">
                                    <ItemTemplate>
                                        <asp:TextBox ID="textDues" runat="server" Text='<%# Bind("Dues") %>' onkeypress="return NumberKeyAndDotKey(this.value,event);"
                                            ondragover="return false" autocomplete="off" onpaste="return false" MaxLength="10" CssClass="textboxForBill"></asp:TextBox>
 
                                    </ItemTemplate>
                                    <HeaderStyle CssClass="edit" />
                                    <ItemStyle CssClass="edit" />
                                    <HeaderStyle Font-Bold="True" />
                                </asp:TemplateField>
                                 <asp:TemplateField HeaderText="Total Penalty Amount (<b>&#2352</b>)">
                                    <ItemTemplate>
                                        <asp:TextBox ID="texttotpenaltyAmt" runat="server" Text='<%# Bind("TotalPenaltyAmount") %>' onkeypress="return NumberKeyAndDotKey(this.value,event);"
                                         Enabled="false"   ondragover="return false" autocomplete="off" onpaste="return false" MaxLength="10" CssClass="textboxForBill"></asp:TextBox>
 
                                    </ItemTemplate>
                                    <HeaderStyle CssClass="edit" />
                                    <ItemStyle CssClass="edit" />
                                    <HeaderStyle Font-Bold="True" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Payment Status">
                                    <ItemTemplate>
                                        <asp:DropDownList ID="ddlPaymentStatus" runat="server" CssClass="textboxForBill" attr-identity="PaymentStatus"
                                            AppendDataBoundItems="True">
                                            <asp:ListItem Value="4">--Select--</asp:ListItem>
                                            <asp:ListItem Value="0">Open</asp:ListItem>
                                            <asp:ListItem Value="1">Paid</asp:ListItem>
                                            <asp:ListItem Value="2">Pending</asp:ListItem>
                                            <asp:ListItem Value="3">Advance</asp:ListItem>
                                        </asp:DropDownList>
                                         <%-- <asp:RequiredFieldValidator ID="rfvPaymentStatus" runat="server" ErrorMessage="*" ControlToValidate="ddlPaymentStatus"
                                            InitialValue="4" SetFocusOnError="True"></asp:RequiredFieldValidator>--%>
                                        <asp:HiddenField ID="hfPaymentStatus" runat="server" Visible="False" Value='<%# Bind("PaymentStatus") %>' />
 
                                    </ItemTemplate>
                                    <HeaderStyle CssClass="edit" />
                                    <ItemStyle CssClass="edit" />
                                    <HeaderStyle Font-Bold="True" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Last Date Without Dues">
                                    <ItemTemplate>
                                        <asp:TextBox ID="textPayEndDate" runat="server" Text='<%# Bind("LastDate") %>' ReadOnly="true"
                                            onkeypress="return NumberKeyAndDotKey(this.value,event);" ondragover="return false"
                                            autocomplete="off" onpaste="return false" MaxLength="10" CssClass="textboxForBill"></asp:TextBox>
 
                                    </ItemTemplate>
                                    <HeaderStyle CssClass="edit" />
                                    <ItemStyle CssClass="edit" />
                                    <HeaderStyle Font-Bold="True" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Paid Date">
                                    <ItemTemplate>
                                        <asp:TextBox ID="textDate" runat="server" ondragover="return false" Text='<%# Bind("AmtPaidDate") %>'
                                            ReadOnly="true" autocomplete="off" onpaste="return false" CssClass="textboxForBill"></asp:TextBox>
 
                                    </ItemTemplate>
                                    <HeaderStyle CssClass="edit" />
                                    <ItemStyle CssClass="edit" />
                                    <HeaderStyle Font-Bold="True" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Remarks From Caretaker">
                                    <ItemTemplate>
                                        <asp:TextBox ID="textAdmin" runat="server" ondragover="return false" class="textarea"
                                            autocomplete="off" onpaste="return false" Text='<%# Bind("RemarkAdmin") %>' TextMode="MultiLine"></asp:TextBox>
 
                                    </ItemTemplate>
                                    <HeaderStyle CssClass="edit" />
                                    <ItemStyle CssClass="edit" />
                                    <HeaderStyle Font-Bold="True" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Remarks From BillPayer">
                                    <ItemTemplate>
                                        <asp:TextBox ID="textUser" runat="server" ondragover="return false" CssClass="textarea" Enabled="false"
                                          class="textarea"  autocomplete="off" onpaste="return false" Text='<%# Bind("RemarkCollector") %>'
                                            TextMode="MultiLine"></asp:TextBox>
 
                                    </ItemTemplate>
                                    <HeaderStyle CssClass="edit" />
                                    <ItemStyle CssClass="edit" />
                                    <HeaderStyle Font-Bold="True" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="" Visible="false">
                                    <ItemTemplate>
                                        <asp:HiddenField ID="hdfId" runat="server" Visible="False" Value='<%# Bind("BGAPRTMNTID") %>' />
                                        <asp:HiddenField ID="HdfldServiceid" runat="server" Visible="False" Value='<%# Bind("SERVICETYPEID") %>' />
                                        <asp:HiddenField ID="hfdBillcollectionID" runat="server" Visible="False" Value='<%# Bind("billCollectionId") %>' />
                                        <asp:HiddenField ID="hfPaymentId" runat="server" Visible="False" Value='<%# Bind("PaymentId") %>' />
                                        <asp:HiddenField ID="hfvBlockId" runat="server" Visible="False" Value='<%# Bind("BlockId") %>' />
                                    </ItemTemplate>
                                </asp:TemplateField>
                            </Columns>
                            <RowStyle />
                            <HeaderStyle CssClass="gridheading" />
                        </asp:GridView>
Posted 28-Nov-12 20:10pm

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 325
1 DamithSL 265
2 CPallini 235
3 Maciej Los 190
4 Sergey Alexandrovich Kryukov 189
0 OriginalGriff 5,455
1 DamithSL 4,422
2 Maciej Los 3,860
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,010


Advertise | Privacy | Mobile
Web04 | 2.8.141216.1 | Last Updated 29 Nov 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100