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. Error: 'Page_Validators' is undefined

Error: 'Page_Validators' is undefined

Scheduled Pinned Locked Moved ASP.NET
sysadminhelp
5 Posts 4 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
    samerh
    wrote on last edited by
    #1

    I have a page where iam hiding a required validator inside a table for a certain textbox. getting this error 'Page_Validators' is undefined. i have added runat="server" for table and validator Any ideas why.

    Y T 2 Replies Last reply
    0
    • S samerh

      I have a page where iam hiding a required validator inside a table for a certain textbox. getting this error 'Page_Validators' is undefined. i have added runat="server" for table and validator Any ideas why.

      Y Offline
      Y Offline
      Yusuf
      wrote on last edited by
      #2

      samerh wrote:

      getting this error 'Page_Validators' is undefined

      Is js error? did you set ControlToValidate to the textboxes?

      Yusuf May I help you?

      S 1 Reply Last reply
      0
      • Y Yusuf

        samerh wrote:

        getting this error 'Page_Validators' is undefined

        Is js error? did you set ControlToValidate to the textboxes?

        Yusuf May I help you?

        S Offline
        S Offline
        samerh
        wrote on last edited by
        #3

        Yes a JS error and yes i set the control to validate N.B when i delete the required validator the error is gone below the code iam using, i have used it 100's of times:

        <asp:TextBox ID="txtSubject" Width="300px" runat="server"></asp:TextBox><asp:RequiredFieldValidator
        ID="ReqVal" Enabled="false" ControlToValidate="txtSubject" runat="server" ErrorMessage="Subject is required!"></asp:RequiredFieldValidator>

        JS:

        var reqValue = document.getElementById('<%=ReqVal.ClientID%>');

        if (FPchk.checked == true)
        ValidatorEnable(reqValue, true);
        else
        ValidatorEnable(reqValue, false);

        1 Reply Last reply
        0
        • S samerh

          I have a page where iam hiding a required validator inside a table for a certain textbox. getting this error 'Page_Validators' is undefined. i have added runat="server" for table and validator Any ideas why.

          T Offline
          T Offline
          Tech Code Freak
          wrote on last edited by
          #4

          I'm facing the same problem.... Searched for the solution but in vain! :( [Update] I've found the solution! Just add a

          <script type="text/javascript">
          var Page_Validators = new Array();
          </script>

          to the start of your page giving the error. And there you go!.....error solved.

          L 1 Reply Last reply
          0
          • T Tech Code Freak

            I'm facing the same problem.... Searched for the solution but in vain! :( [Update] I've found the solution! Just add a

            <script type="text/javascript">
            var Page_Validators = new Array();
            </script>

            to the start of your page giving the error. And there you go!.....error solved.

            L Offline
            L Offline
            Lost User
            wrote on last edited by
            #5

            great! it works fine.

            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