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. errormessage from two separate validators appearing in the same place

errormessage from two separate validators appearing in the same place

Scheduled Pinned Locked Moved ASP.NET
help
4 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.
  • L Offline
    L Offline
    livez
    wrote on last edited by
    #1

    Hello! I´ve got a textbox where the user can write his/her email. I´ve got two validators pointing at this textbox, one asp:RequiredFieldValidator to make sure textbox is not empty and one asp:RegularExpressionValidator to make sure the email adress is correct (tried to use asp:RegularExpressionValidator but couldnt get it to work). My problem is to make the errors from these two validators showing in the same place. Right now it goes something like this:

    [textbox for email ]
    error1! error2!

    thanks!

    T A 2 Replies Last reply
    0
    • L livez

      Hello! I´ve got a textbox where the user can write his/her email. I´ve got two validators pointing at this textbox, one asp:RequiredFieldValidator to make sure textbox is not empty and one asp:RegularExpressionValidator to make sure the email adress is correct (tried to use asp:RegularExpressionValidator but couldnt get it to work). My problem is to make the errors from these two validators showing in the same place. Right now it goes something like this:

      [textbox for email ]
      error1! error2!

      thanks!

      T Offline
      T Offline
      Talal Sultan
      wrote on last edited by
      #2

      You can try setting the Display property to Dynamic. Example:

      <asp:RequiredFieldValidator ID="requiredEmailAddress" runat="server" ControlToValidate="txtEmailAddress" Display="Dynamic" CssClass="SomeClass"></asp:RequiredFieldValidator>

      -- If this is a post that has been helpful to you, please vote for it. Thank you! "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." --Rich Cook

      1 Reply Last reply
      0
      • L livez

        Hello! I´ve got a textbox where the user can write his/her email. I´ve got two validators pointing at this textbox, one asp:RequiredFieldValidator to make sure textbox is not empty and one asp:RegularExpressionValidator to make sure the email adress is correct (tried to use asp:RegularExpressionValidator but couldnt get it to work). My problem is to make the errors from these two validators showing in the same place. Right now it goes something like this:

        [textbox for email ]
        error1! error2!

        thanks!

        A Offline
        A Offline
        Abhijit Jana
        wrote on last edited by
        #3

        Just Set the **Display="Dynamic"** for both the validation control By default it is static. You have to change to to dynamic. You can change i from code behind or from Validation control property itself. :)

        cheers, Abhijit CodeProject.Com MVP

        L 1 Reply Last reply
        0
        • A Abhijit Jana

          Just Set the **Display="Dynamic"** for both the validation control By default it is static. You have to change to to dynamic. You can change i from code behind or from Validation control property itself. :)

          cheers, Abhijit CodeProject.Com MVP

          L Offline
          L Offline
          livez
          wrote on last edited by
          #4

          duh ;) thanks alot guys!

          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