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 to disable one required field vaildator

How to disable one required field vaildator

Scheduled Pinned Locked Moved ASP.NET
comsysadminhelptutorialquestion
3 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.
  • R Offline
    R Offline
    Rizwan Bashir
    wrote on last edited by
    #1

    I have some scenario of option button.. suppose Gender Male /Female if User select Male then one textbox to validate and if user select female then nothing to validate.but in my case it is running no matter which option button is selected. Can any one help me how to make the code for this condition. The Control should run on server side validation. I dont know how to get the solution of this.. Any Idea's ????

    Rizwan Bashir ALM Soft[^]

    M 1 Reply Last reply
    0
    • R Rizwan Bashir

      I have some scenario of option button.. suppose Gender Male /Female if User select Male then one textbox to validate and if user select female then nothing to validate.but in my case it is running no matter which option button is selected. Can any one help me how to make the code for this condition. The Control should run on server side validation. I dont know how to get the solution of this.. Any Idea's ????

      Rizwan Bashir ALM Soft[^]

      M Offline
      M Offline
      marconi Flangepants
      wrote on last edited by
      #2

      Is posssible to set ValidationControl disabled. So make condition statement like if(some condition) { Control.Enabled=false; } else { control.Enabled=true; }

      E 1 Reply Last reply
      0
      • M marconi Flangepants

        Is posssible to set ValidationControl disabled. So make condition statement like if(some condition) { Control.Enabled=false; } else { control.Enabled=true; }

        E Offline
        E Offline
        ednrgc
        wrote on last edited by
        #3

        Or Simply: Control.Enabled=(!condition)

        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