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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. JavaScript
  4. Javascript code to automatically check the checkbox of duplicate record in gridView

Javascript code to automatically check the checkbox of duplicate record in gridView

Scheduled Pinned Locked Moved JavaScript
javascript
2 Posts 2 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.
  • U Offline
    U Offline
    User 10452658
    wrote on last edited by
    #1

    In GridView, one column is of checkboxes, I need that if any duplicate record is there for e.g. Name is duplicate and we check its checkbox then record of its duplicate name should also get checked.

    R 1 Reply Last reply
    0
    • U User 10452658

      In GridView, one column is of checkboxes, I need that if any duplicate record is there for e.g. Name is duplicate and we check its checkbox then record of its duplicate name should also get checked.

      R Offline
      R Offline
      Raviranjan_Kumar_Sinha
      wrote on last edited by
      #2

      Hi, Lets assume that you want to do on Name so if check one checkbox with Name Ravi and there are 3 record with Name Ravi then all 3 checkbox should get checked, so you can do like below, lets say that you are having checkboxes

      JQuery Code $("#mainGridDiv input[type=checkbox]").change(function(){ var currValue = $(this).val(); $("#mainGridDiv input[type=checkbox]").find("[value='"+currValue+"']").attr("checked",$(this).checked) }); NOTE:Assuming checkbox is one column of your grid. Thanks Raviranjan

      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