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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. How to check validator control is valid or not in javascript...

How to check validator control is valid or not in javascript...

Scheduled Pinned Locked Moved ASP.NET
javascripthelptutorialquestion
3 Posts 3 Posters 1 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.
  • A Offline
    A Offline
    Amit Amit Amit
    wrote on last edited by
    #1

    Hi all I m using regularexpressionvalidator to validate email id. i have a submit button to submit the page.i m calling some javascript onclientclick of submit button. now i want to check that regularexpressionvalidator is valid or not onclientclick of that submit button.... how can i do this.... Please Help me... thanks in advance...

    Amit Metkar 3i-infotech, Mumbai.

    K V 2 Replies Last reply
    0
    • A Amit Amit Amit

      Hi all I m using regularexpressionvalidator to validate email id. i have a submit button to submit the page.i m calling some javascript onclientclick of submit button. now i want to check that regularexpressionvalidator is valid or not onclientclick of that submit button.... how can i do this.... Please Help me... thanks in advance...

      Amit Metkar 3i-infotech, Mumbai.

      K Offline
      K Offline
      keyboard warrior
      wrote on last edited by
      #2

      The "Regular Expression" Validator will validate when they type something in and it is not correct. The Validator will check onBlur. Regular Expression Does not make the field "Required" You still need to add a validator to require the field as well. EDIT "now i want to check that regularexpressionvalidator is valid or not onclientclick of that submit button...." This already happens when they type in the text box. unless they leave it blank, this ALREADY happens. why dont you build it first and actually try the control.

      ----------------------------------------------------------- "When I first saw it, I just thought that you really, really enjoyed programming in java." - Leslie Sanford

      modified on Friday, May 23, 2008 2:03 AM

      1 Reply Last reply
      0
      • A Amit Amit Amit

        Hi all I m using regularexpressionvalidator to validate email id. i have a submit button to submit the page.i m calling some javascript onclientclick of submit button. now i want to check that regularexpressionvalidator is valid or not onclientclick of that submit button.... how can i do this.... Please Help me... thanks in advance...

        Amit Metkar 3i-infotech, Mumbai.

        V Offline
        V Offline
        Vinay Dornala
        wrote on last edited by
        #3

        Hi, Write javascript function for example ValidatePage() call this in OnClientClick event of Submit Button like this function ValidatePage() { Page_ClientValidate(); if (Page_IsValid) { return false } else { return false; } } or in page_load add this line btnSubmit.add.Attributes('onClick','return ValidatePage();')

        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