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. Validating Check Boxes

Validating Check Boxes

Scheduled Pinned Locked Moved ASP.NET
csharpasp-nethelptutorialquestion
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.
  • S Offline
    S Offline
    seemamltn
    wrote on last edited by
    #1

    I'm having a problem which I thought would be a very simple thing but is > > turning out to be a difficult challenge. I have a web form with several input > > fields and I have a single checkbox, not a checkbox list. Before the form can > > be submitted I want to require that the checkbox be checked. Sounds simple > > but non of the validation controls seem to work correct for this, or maybe > > I'm just not using them correctly. I have done several searches but I can't > > seem to find any examples of this type of thing being done. Which is very > > surprising because this sort of checkbox is a very common thing. i.e. "I > > agree to the terms....." Can anyone point me to an example? I'm using ASP.NET > > 2.0 Thanks

    seema

    A 1 Reply Last reply
    0
    • S seemamltn

      I'm having a problem which I thought would be a very simple thing but is > > turning out to be a difficult challenge. I have a web form with several input > > fields and I have a single checkbox, not a checkbox list. Before the form can > > be submitted I want to require that the checkbox be checked. Sounds simple > > but non of the validation controls seem to work correct for this, or maybe > > I'm just not using them correctly. I have done several searches but I can't > > seem to find any examples of this type of thing being done. Which is very > > surprising because this sort of checkbox is a very common thing. i.e. "I > > agree to the terms....." Can anyone point me to an example? I'm using ASP.NET > > 2.0 Thanks

      seema

      A Offline
      A Offline
      Amit Kumar G
      wrote on last edited by
      #2

      Seema, No one can help you unless see your code....So please post your code!! In the meantime you can look into... <%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default2.aspx.vb" Inherits="Default2" %> Untitled Page

      Protected Sub btnSubmit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSubmit.Click If Me.ChkName.Checked = True Then Response.Write("Selected") Else Response.Write("Not Selected") End If End Sub Thanks!! -- modified at 15:06 Wednesday 19th September, 2007 Amit Gugnani

      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