function chk()
  var x=document.getElementByID("txtmax");
<form runat="server" id="form1">
MaxValue:<asp:textbox id="txtboxmax" runat="server" />
<asp:gridview id="gr" runat="server" >
        <asp:textbox id="txtboxmin" runat="server" />
        <asp:CustomValidator ID="cv" runat="server" EnableClientScript="true" ControlToValidate="txtmin" ClientValidationFunction="Chk()" ErrorMessage="*" />
    <asp:boundfield datafield="name"/>

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.

hope this helps

function chk(txtmin)
var tmax=document.getelementbyid('txtmax');
   alert('min value');

in the design of datgrid  for template field containing txtmin change the function with chk(this);