Custom Validator not working

Hello Experts,
My CustomValidator is not working in my local machine.  But when deployed in Windows Server 2008 machine, it is working.  Any idea why it is behaving like this?  Below is the environment I am using.  Thank you in advance.

OS: Windows 7
Visual Studio: 2010
Server: Windows 2008 R2

Thank You!
RadhaKrishnaKiJayaAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

sammySeltzerCommented:
Since no code, I fashion a guess.

What browser are you using?

I suspect you are using jquery?

What if you add this line to the top of your page between <head>...</head> section?

<meta http-equiv="X-UA-Compatible" content="IE=7, IE=8, IE=9, IE=10, IE=11" />

Open in new window


You can also hit the f12 key if using IE or firebug if using firefox to get better idea of what is going on.

If all else fails, you can show some code.
0
RadhaKrishnaKiJayaAuthor Commented:
Hi sammySeltzer,
Thank you for your help.  I am using IE 11.  I am not using jQuery.  Just using ASP.NET inbuilt validator with JavaScript.    Please explain more, how the F12 key works?  Also, what does the following line will do?

<meta http-equiv="X-UA-Compatible" content="IE=7, IE=8, IE=9, IE=10, IE=11" />

Thank you!
0
sammySeltzerCommented:
I suggested using F12 because I assumed you were using some javascript. That helps with debugging.

The meta tag is intended to make those browsers listed compatible, again, assume some jquery is being used.

can you show your code, just the customValidator bit?
0
Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

RadhaKrishnaKiJayaAuthor Commented:
If I copy this code to a different program and try to run, it works just fine.  

<HTML>
      <HEAD>
            <title>Credit Card Check</title>
            <script language="javascript">
            function ValidateMonth(source, arguments)
            {
                  if(window.Form1.ddlMonth.options.selectedIndex == 0)
                        arguments.IsValid = false;
                  else
                        arguments.IsValid = true;
                        
            }

            </script>
       </HEAD>


      <body bgColor="#a7a7db" MS_POSITIONING="GridLayout">
            <form id="Form1" onsubmit="javascript:ValidateMe();" method="post" runat="server">
                  <table style="WIDTH: 592px" cellSpacing="0" cellPadding="0" border="0">

                        <tr>
                              <td style="WIDTH: 305px; HEIGHT: 5px">Expiration Month:</td>
                              <td class="style3"><asp:dropdownlist id="ddlMonth" runat="server" Width="112px">
                                          <asp:ListItem Value="Select Month">Select Month</asp:ListItem>
                                          <asp:ListItem Value="01">Jan</asp:ListItem>
                                          <asp:ListItem Value="02">Feb</asp:ListItem>
                                          <asp:ListItem Value="03">Mar</asp:ListItem>
                                          <asp:ListItem Value="04">Apr</asp:ListItem>
                                          <asp:ListItem Value="05">May</asp:ListItem>
                                          <asp:ListItem Value="06">Jun</asp:ListItem>
                                          <asp:ListItem Value="07">Jul</asp:ListItem>
                                          <asp:ListItem Value="08">Aug</asp:ListItem>
                                          <asp:ListItem Value="09">Sep</asp:ListItem>
                                          <asp:ListItem Value="10">Oct</asp:ListItem>
                                          <asp:ListItem Value="11">Nov</asp:ListItem>
                                          <asp:ListItem Value="12">Dec</asp:ListItem>
                                    </asp:dropdownlist>&nbsp;&nbsp;
                        </tr>
                        <tr>
                              <td style="HEIGHT: 18px" colSpan="3"><asp:customvalidator id="Customvalidator3" runat="server" ControlToValidate="ddlMonth" ErrorMessage="Selected Month is not a valid selection "
                        ClientValidationFunction="ValidateMonth"></asp:customvalidator><br />

                        </tr>

            </form>
      </body>
</HTML>
0
sammySeltzerCommented:
Sorry for the late response.

If all you are doing is just validating the dropdownlist, why not make it simple and easy?

Something like:

       <HEAD>
             <title>Credit Card Check</title>
        </HEAD>


       <body bgColor="#a7a7db" MS_POSITIONING="GridLayout">
             <form id="Form1" onsubmit="javascript:ValidateMe();" method="post" runat="server">
                   <table style="WIDTH: 592px" cellSpacing="0" cellPadding="0" border="0">

                         <tr>
                               <td style="WIDTH: 305px; HEIGHT: 5px">Expiration Month:</td>
                               <td class="style3"><asp:dropdownlist id="ddlMonth" runat="server" Width="112px" AppendDataBoundItems="True">
                                           <asp:ListItem Value="Select Month">Select Month</asp:ListItem>
                                           <asp:ListItem Value="01">Jan</asp:ListItem>
                                           <asp:ListItem Value="02">Feb</asp:ListItem>
                                           <asp:ListItem Value="03">Mar</asp:ListItem>
                                           <asp:ListItem Value="04">Apr</asp:ListItem>
                                           <asp:ListItem Value="05">May</asp:ListItem>
                                           <asp:ListItem Value="06">Jun</asp:ListItem>
                                           <asp:ListItem Value="07">Jul</asp:ListItem>
                                           <asp:ListItem Value="08">Aug</asp:ListItem>
                                           <asp:ListItem Value="09">Sep</asp:ListItem>
                                           <asp:ListItem Value="10">Oct</asp:ListItem>
                                           <asp:ListItem Value="11">Nov</asp:ListItem>
                                           <asp:ListItem Value="12">Dec</asp:ListItem>
                                     </asp:dropdownlist>&nbsp;&nbsp;
                                     <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="ddlMonth"
				     ErrorMessage="Selected Month is not a valid selection" InitialValue="Select Month"></asp:RequiredFieldValidator>
                           </td>
                                
                         </tr>

             </form>
       </body>
 </HTML> 

Open in new window

0
RadhaKrishnaKiJayaAuthor Commented:
Thank you sammySeltzer,

The reason I am not using that is, I have Year to select from the dropdown too and  I need to use the CustomValidator to validate Year must be >= Current Year, which RequiredFieldValidator cannot validate this.

The problem is this is not a new code.  This has been running for years together.  I don't know what happened, this stopped working.  

Thank you!
0
sammySeltzerCommented:
Why not use CompareValidator for Year while using RequiredFieldValidator for other controls?

Something like:

<asp:CompareValidator ID="yearCompare" runat="server" ErrorMessage="Year must be >= Current Year" ControlToCompare="CurrentYear" 
        ControlToValidate="what?"></asp:CompareValidator>

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
RadhaKrishnaKiJayaAuthor Commented:
Thank you sammySeltzer.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.