473,378 Members | 1,469 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

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 1672
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

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

Similar topics

15
by: optimistx | last post by:
How to write a function f(x) or f('x') so that it produces the same output as a call to alert-function: var x='abc'; alert('x='+x); In testing one needs to write similar alert() calls...
2
by: schieco | last post by:
The following code always prints the debug lines inside the conditional if statement before and after the alert statement when the session has timed out, but the alert and redirect only appear/work...
4
by: hugo2 | last post by:
Most of these characters are not on the standard keyboard. Here's a successful contrivance, with comments & cautions, a little page that works in IE6. <HTML><HEAD><SCRIPT TYPE="text/javascript">...
3
by: umdsasha | last post by:
So, basically, I need to detect whether an alert window was thrown. I can't find where it's thrown from but I need to disable a button only if there were no alert windows thrown. Any ideas? ...
24
by: Jeremy J Starcher | last post by:
While reading c.l.j, I've noticed that some people prefer and indeed even recommend the use of "window.alert()" over "alert()". I can't find any technical reason to make this distinction, and...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.