Compare two Template Fields of Gridview
-
Hi all, May we compare the two template fields of Gridview with Compare Validator like below
/asp:TextBox>
I want to validate the Receive Item with Qty using Compare Validator that User can not insert value greater than qty in Receive Item. Any Idea Regards,
-
Hi all, May we compare the two template fields of Gridview with Compare Validator like below
/asp:TextBox>
I want to validate the Receive Item with Qty using Compare Validator that User can not insert value greater than qty in Receive Item. Any Idea Regards,
Hi, Try the below code,
Hope this helps.
-Manognya
__________________________________________________
$ God gives what is best.Not what all you wish :) -
Hi all, May we compare the two template fields of Gridview with Compare Validator like below
/asp:TextBox>
I want to validate the Receive Item with Qty using Compare Validator that User can not insert value greater than qty in Receive Item. Any Idea Regards,
you can use custom validator with client validation function as below..
function compare(source,args)
{
var receive = parseInt(document.getElementById('txtReciveItem').value);
var sending = parseInt(document.getElementById('txtSendingQty').value);if (receive > sending) { args.Isvalid=false; } else { args.Isvalid=true; }
}
see more here[^] on custom validators
with regards Karthik Harve
-
Hi all, May we compare the two template fields of Gridview with Compare Validator like below
/asp:TextBox>
I want to validate the Receive Item with Qty using Compare Validator that User can not insert value greater than qty in Receive Item. Any Idea Regards,
I guess you can, or may I don't see the point of it. Just put the qty value in the receive textbox, so the user doesn't have to type in the number unless needed. What if more are received than ordered? Check the value when the form is submitted on the client or server side.