469,945 Members | 1,519 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,945 developers. It's quick & easy.

alert box

sheenattt
I am working in C#.Net and using JavaScript to validate my form.When I use the inbuilt Validators of ASP.Net like "Required Field Validator" or any other,it wont work with JavaScript.Can anyone tell me why?Or how can I make it work with JS?Do help.Thanks
Nov 24 '06 #1
2 1598
AricC
1,892 Expert 1GB
Post your code so we can check.
Nov 25 '06 #2
Here JS is working fine but Validator Message box is not.Do help.Thnx


Expand|Select|Wrap|Line Numbers
  1. <html xmlns="http://www.w3.org/1999/xhtml" >
  2. <head runat="server">
  3. <title>Untitled Page</title>
  4.  
  5. </head>
  6. <script language="javascript">
  7. function check()
  8.     {
  9.     if(form1.DDMONTH.value=="")
  10.     {
  11.     alert("Select month");
  12.     return false;
  13.     }  
  14.    }    
  15.  </script>
  16. <body>
  17.  <form id="form1" runat="server">
  18. <asp:TextBox ID="TextBox1" runat="server" Height="18px" Width="111px"></asp:TextBox>
  19. <asp:DropDownList ID="DDMONTH" runat="server">
  20. </asp:DropDownList>
  21. <asp:CompareValidator ID="CompareValidator1" runat="server" ControlToValidate="TextBox1" ErrorMessage="Enter numeric value" Operator="DataTypeCheck" SetFocusOnError="True"                     Type="Integer"></asp:CompareValidator>
  22.  <asp:ValidationSummary ID="ValidationSummary1" runat="server" Height="43px" ShowMessageBox="True"  Width="175px" />
  23.  
  24. <asp:Button ID="Button1" runat="server" Text="Submit" Font-Bold="True" Width="97px" OnClick="Button1_Click" OnClientClick="return check()" />
  25.  
Nov 25 '06 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

15 posts views Thread by optimistx | last post: by
2 posts views Thread by schieco | last post: by
24 posts views Thread by Jeremy J Starcher | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.