Click here to Skip to main content
15,887,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm using a gridview to show and update database..
girdview code is like dis..
XML
<asp:GridView ID="grdImage" runat="server" AutoGenerateColumns="false"
                                Width="82px" DataKeyNames="BannerId">
                                <Columns>
                                    <asp:BoundField HeaderText="Image Name" DataField="ImageName" />
                                    <asp:BoundField HeaderText="Image" DataField="Image" />
                                    <asp:TemplateField HeaderText="Position">
                                    <ItemTemplate >
                                       <asp:TextBox ID="txtPosition" runat="server" Width="50px" Text='<%# Eval("Position")%>' >
                                        </asp:TextBox>
                                    </ItemTemplate>
                                    </asp:TemplateField>
                                </Columns>
                            </asp:GridView>
<asp:Button ID="btnSave" runat="server" Text="Save" onclick="btnSave_Click" />


to update data user will enter integer values in textboxes and click save button.
i need a client side javascript validation to check values entered in textboxes are not repeating in anothertext boxes except 0 ..
Posted

 
Share this answer
 
Comments
Legendof507 13-May-11 1:49am    
but how do i check for values entered in textboxes are not repeating in another textbox ?
Ashishmau 13-May-11 3:29am    
Have u got how to take gridview cell value in javascript from above links...if yes then Compare values in javascript and check...
<asp:TextBox ID="txtPosition" runat="server" Width="50px" Text='<%# Eval("Position")%>' >
                                        </asp:TextBox>

Put a OnClientClick attribute in it. Use it. Tie a JS method. Pass 'this' as one of the parameter to method. In mehtod, check the value of the textbox and take appropriate action.
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900