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. How can i validate a checkbox control?

How can i validate a checkbox control?

Scheduled Pinned Locked Moved ASP.NET
questionhelp
5 Posts 3 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.
  • J Offline
    J Offline
    just3ala2
    wrote on last edited by
    #1

    Dear all, My issue is that I don't want to submit the form is the checkbox isn't checked and i want to make it through validators which validator should i use and how?

    Best Regards 3ala2 :)

    T N J 3 Replies Last reply
    0
    • J just3ala2

      Dear all, My issue is that I don't want to submit the form is the checkbox isn't checked and i want to make it through validators which validator should i use and how?

      Best Regards 3ala2 :)

      T Offline
      T Offline
      thomas_joyee
      wrote on last edited by
      #2

      Use javascript

      Thomas

      J 1 Reply Last reply
      0
      • T thomas_joyee

        Use javascript

        Thomas

        J Offline
        J Offline
        just3ala2
        wrote on last edited by
        #3

        i know!!! But i can't control the button action because i have other validators in the form so i can do both together anyway, i'm workin on something guess it should work... Thanx for replying

        Best Regards 3ala2 :)

        1 Reply Last reply
        0
        • J just3ala2

          Dear all, My issue is that I don't want to submit the form is the checkbox isn't checked and i want to make it through validators which validator should i use and how?

          Best Regards 3ala2 :)

          N Offline
          N Offline
          needhelpinnet
          wrote on last edited by
          #4

          validation contrlos are predefined.genrally works on text boxes.it is not possible as per user by validation controls.if u realy want to validate u have to write seperate logic for that.by using script lagu..

          1 Reply Last reply
          0
          • J just3ala2

            Dear all, My issue is that I don't want to submit the form is the checkbox isn't checked and i want to make it through validators which validator should i use and how?

            Best Regards 3ala2 :)

            J Offline
            J Offline
            just3ala2
            wrote on last edited by
            #5

            I did it... var ucName = "UcPayToAccountant1_"; function jsValidate() { if ( checkAmount() && checkDone() ) { Page_ClientValidate(); return true; } else { return false; } } // End Function function checkAmount() { var amount = document.getElementById(ucName + "txtAmount").value; if ( isNaN(amount) ) { return false; } else { return true; } } // End Function function checkDone() { var done = document.getElementById(ucName + "chkDone"); if (done.checked) { return true; } else { return false; } } // End Function added the onclick attribute the button so using Page_ClientValidate(); function which the validator generates solved the probelm

            Best Regards 3ala2 :)

            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