Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Compare two Template Fields of Gridview

Compare two Template Fields of Gridview

Scheduled Pinned Locked Moved ASP.NET
4 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Rameez Raja
    wrote on last edited by
    #1

    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,

    M K J 3 Replies Last reply
    0
    • R Rameez Raja

      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,

      M Offline
      M Offline
      manognya kota
      wrote on last edited by
      #2

      Hi, Try the below code,

      Hope this helps.

      -Manognya
      __________________________________________________
      $ God gives what is best.Not what all you wish :)

      1 Reply Last reply
      0
      • R Rameez Raja

        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,

        K Offline
        K Offline
        Karthik Harve
        wrote on last edited by
        #3

        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

        1 Reply Last reply
        0
        • R Rameez Raja

          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,

          J Offline
          J Offline
          jkirkerx
          wrote on last edited by
          #4

          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.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups