?
Solved

Error Messages on a web form

Posted on 2012-03-21
2
Medium Priority
?
180 Views
Last Modified: 2012-06-27
Hi Everyone,

I need to place error messages on fields when they are left blank and they are required and must be numeric or alphabetic characters.

Where do I place an error message on say the Driver License Number left blank.  I know I can place messages when I try to add the record on an event button "ADD New", but I want the message to appear if the user selects enter or tabs to the next field or when the field loses focus.  Where do I do this.  I tried to do it in the textChanged event of the field, but the message does not appear when I select enter or tab to the next field.

jjc9809
0
Comment
Question by:jjc9809
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 7

Expert Comment

by:Lalit Chandra
ID: 37748264
you can try the below technique to solve your problem

<script>
function emailcheck(){
var string1=document.example.email.value
if (string1.indexOf("@")==-1){
.alert("Please input a valid email address!")
.document.example.email.focus()
.}
}
</script>

<form name="example"><input type="text" size="20" name="email" onblur="emailcheck()">
<strong>Feedback please:</strong>
<textarea name="S1" rows="2" cols="20"></textarea>
<input type="submit" name="B1" value="Submit">
</form>
0
 
LVL 29

Accepted Solution

by:
Paul Jackson earned 2000 total points
ID: 37748278
PLease have a look at the linked article which describes using validation controls in asp.net, these controls check validation on the server side but also can be enabled to check validation on the clientside such as when leaving a field.

Vaidating USer INput in ASP.Net

Client-Side validation for asp.net Server-Controls
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question