guptaalok12 0 Light Poster
<head>
<script>
function chk()
{
  var x=document.getElementByID("txtmax");
  
}
</script>
</head>
<body>
<form runat="server" id="form1">
MaxValue:<asp:textbox id="txtboxmax" runat="server" />
<asp:gridview id="gr" runat="server" >
  <columns>
      <asp:templatecolumn>
        <asp:textbox id="txtboxmin" runat="server" />
        <asp:CustomValidator ID="cv" runat="server" EnableClientScript="true" ControlToValidate="txtmin" ClientValidationFunction="Chk()" ErrorMessage="*" />
     </asp:templatecolumn">
    <asp:boundfield datafield="name"/>
 </column>
</asp:gridview>
</form>
</body>

i want compare the value of txtmax in the GridView with the txtmin through javascript.if txtmax value is greater than txtmin value.then custom error (*) should displayed.above is my code.the problem how can i pass my txtmax value to chk() function.Pls help.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.