0

i am dynamically adding text box in gridview.now i enter a value in textbox and i want to compare this value with another textbox value in the client side through javascripe .can i do it. Pls help.

3
Contributors
2
Replies
3
Views
9 Years
Discussion Span
Last Post by greeny_1984
0

Dear Guptaalok12,

I will try to solve your problem. I hope it works.

<script language="javascript">
    function check(obj)
    {
        if(obj.value!=form1.TextBox1.value)
        {
            alert('False');
        }
        else
        {
            alert('True');
        }
    }
</script>

and in your GridView TextBox

<asp:TemplateField HeaderText="Remark">
     <ItemTemplate>
         <asp:TextBox ID="TxtRemark" runat="server" Width="100%" Enabled=false onblur = "check(this)"></asp:TextBox>
     </ItemTemplate>
</asp:TemplateField>

Thanks,

Kusno.

0

u said u r dynamically adding textboxes in u r datagrid,for that set attributes to runat at server like this

txt.attributes.add("ruant","server");
just like any other text comparision u can do the coding

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.