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. RequiredFieldValidator Problem

RequiredFieldValidator Problem

Scheduled Pinned Locked Moved ASP.NET
helpquestion
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.
  • K Offline
    K Offline
    ksaw123
    wrote on last edited by
    #1

    I have created a form using a panel. The form contains several textboxes and labels (name of the fields) and also three buttons (first one: Insert, second one: Reset, third one: Cancel). I have also added one RequiredFieldValidator on one of the textboxes which is the primary key. When I write something on the textboxes except required filed (that has RequiredFieldValidator) then I pressed Reset it gives shows me the message of RequiredFieldValidator or even when I pressed Cancel it gives me the same thing. How can I handle this (means when pressing Reset it will reset all the fields without showing the message and when pressing Cancel it will reset all the fields and make the panel invisible)? Thanks in advance for your help. Best regards,

    V 1 Reply Last reply
    0
    • K ksaw123

      I have created a form using a panel. The form contains several textboxes and labels (name of the fields) and also three buttons (first one: Insert, second one: Reset, third one: Cancel). I have also added one RequiredFieldValidator on one of the textboxes which is the primary key. When I write something on the textboxes except required filed (that has RequiredFieldValidator) then I pressed Reset it gives shows me the message of RequiredFieldValidator or even when I pressed Cancel it gives me the same thing. How can I handle this (means when pressing Reset it will reset all the fields without showing the message and when pressing Cancel it will reset all the fields and make the panel invisible)? Thanks in advance for your help. Best regards,

      V Offline
      V Offline
      VanithaVasu
      wrote on last edited by
      #2

      For the cancel and Reset button u can set the cause validation property to false so that when u click these button the required field validator will not be checked.By default cause validation property for all buttons will be set to true. So we have to change it. And for insert button the only way is you have to alternatively visible true or false, for the required field validator.

      VanithaVasu

      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