473,785 Members | 2,396 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Validating Text field against database.

92 New Member
I have developed a web page using ASP classic, I am using VBScript for database connectivity... The web application is working fine, but i am now working on a new enhancement requirement where i need to validate the ID# entered into a text box by the users against a new database. This validation should happen as soon as the User enters his ID#.

Once the user enters the ID#, it should check the availabity of the ID# in the database table, if it does not exists a Message should pop up saying "Invalid ID number entered"

Here is the code for your review.

<tr>
<td bordercolor="#F FFFFF" bgcolor="#33339 9"> <div align="center"> <font color=#FFFFFF
size=2 face="Verdana, Arial, Helvetica, sans-serif"><strong> PeopleSoft ID</strong></font></div></td>
<td bordercolor="#F FFFFF"> <input maxlength=6 size=13 name=ID />
</td>
</tr>

In the above sample code snippet, we need to add validation against database..And this validation should happpen before the form submission
Jun 30 '09 #1
10 3257
Dormilich
8,658 Recognized Expert Moderator Expert
@chandhseke
sounds like a job for AJAX

@chandhseke
would it be that tragic, if you do the validation along with the form submission?

@chandhseke
your HTML is horribly out of date. the <font> tag is deprecated for decades (feels like) now and every attribute value should be quoted. (real XHTML will error out otherwise) and tables should not be used for layout (that's the job of CSS).
Jul 1 '09 #2
JosAH
11,448 Recognized Expert MVP
@Dormilich
Care to elaborate on that? I know (almost) nothing about html and css but I have to write some documentation in html now and then. I always happily use tables to display data in tabular form ... all I knew was that css is able to fiddle with the borders, captions, relative sizes of the tables ... I can't find anything appropriate in the w3schools either.

kind regards,

Jos

ps. sorry for intruding this thread ;-)
Jul 1 '09 #3
Dormilich
8,658 Recognized Expert Moderator Expert
@JosAH
tables for page layout were used when the CSS support of the browsers was sparse (80s and early 90s). so tables (with border="0") were used to put all elements in place, like a grid.

the disadvantage is, that the mark-up is neither semantic, nor readable (despite being much larger in size, which eventually you have to pay with traffic costs and rendering speed).

but now that CSS is widely supported (more or less also in *cough* IE) all the positioning and eye candy can be done using CSS.


check out ALA's Primer Part 2 (Part 1), there you should find some useful resources. or ask drhowarddrfine or David Laakso (and some other HTML/CSS experts) on this matter.

@JosAH
I do not put that in question, if you have tabular data, tables are the way to go.

@JosAH
the ultimate resource of CSS 2.1 (aka TechSpec)

comprehensive look-up site (german) ← well organized and compact
Jul 1 '09 #4
JosAH
11,448 Recognized Expert MVP
Thanks for the links (I put them in my bookmarks already ;-) The first link gave me the clue: by using divs I can get a similar look as with those tables; it's nice. For real tabular data I'll use tables otherwise I use those divs with their css layout tags.

kind regards,

Jos
Jul 1 '09 #5
Curtis Rutland
3,256 Recognized Expert Specialist
Yeah, that's what I've learned Jos. Tables are not for layout anymore. Real, tabled data goes in them, otherwise, divs and css. Apparently one big difference is properly laid out HTML/CSS with divs rather than tables is much more search-engine-optimizable.
Jul 1 '09 #6
Dormilich
8,658 Recognized Expert Moderator Expert
@insertAlias
not to forget lists & CSS…
Jul 1 '09 #7
chandhseke
92 New Member
But my question is different..Let me make a long story into short : I am working as a Support and Maintenance enginner for web applications..T his a new requirement from our customers.. We are using ASP classic, JavaScript and VB script.. In one of our applications, when the employee enters thier Employee_ID they need to check this against database for the availabilty as the employees FAT fingured few times and the records created with wrong EMp_ID's.. So as soon the Employee enters thier ID in the text box, it should check against a database table ESH..Any suggestions would be appreciated,,

Many Thanks
Jul 1 '09 #8
Dormilich
8,658 Recognized Expert Moderator Expert
well, to cite me again…

@Dormilich
unfortunately, I can't help you with ASP and VB script.
Jul 1 '09 #9
Curtis Rutland
3,256 Recognized Expert Specialist
We do, however, have an ASP Classic Forum that you should visit.
Jul 1 '09 #10

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

Similar topics

3
4980
by: Mats | last post by:
It's good practice to validate input, not only where it should be coming from, but from anywhere it's possible to change or add input for a "client". If all user input is transfered using "post" you can be pretty tough on querystrings, if you use them at all. But user input could have a name like Mc'Donald, and we would not like quotes (wether single or double) in input to a database or an asp script. Though I beleive more dangerous in...
3
14021
by: Mark | last post by:
Hi, Im trying to validate a form, all the validating works apart from one field. This particular field must consist of the first 2 characters as letters, & the following 5 as numbers. And if it dosent meet these requirments an error message will be displayed. I have pasted the code (and highlighted the relevant parts) below in the hope that someone can help me out with this. Ive been trying to suss it out all week & it's driving me nuts!...
30
3917
by: Toni Mcintyre | last post by:
i'm having 2 problems with the http://validator.w3.org 1. if i have: <meta http-equiv="Content-Script-Type" content="text/javascript"> then why do i need <script type=text/javascript> everywhere??? i'm writing most of my code by hand, so this is a lot of extra typing or global search and replace later 2. the other problem is with my include files: i usually <script src="foo.js"></script>
1
4337
by: Christian | last post by:
Hi, I load an Xml-file "customers.xml" into a DataSet (works fine) but then how do I validate it against a schema (e.g. customers.xsd) ? my customers.xml: <?xml version="1.0" encoding="utf-8"?>| <customers xmlns="http://tempuri.org/customers.xsd"> <Customer ID="1000"> <FirstName>Greg</FirstName>
5
5988
by: Steve | last post by:
I am currently trying to validate data in an access database. I need to verify that columns containing date information are in the format ddmmyyyy and columns containg time information are in the format HH:MM 24. The dates and times are stored in text fields. ie date 12121998, time 20:34 Could anyone suggest a method for validating the fields. What is the syntax for converting text fields into dates and times? Any suggestions...
5
3595
by: pmud | last post by:
Hi, I am using a compare validator in asp.net application(c# code). This is used for comparing a value enterd by the user against the primary key in the SQL database. IF the VALUE ENTERED BY THE USER EXISTS IN THE DB , then THE ERROR MESSAGE OF THE COMPARE VALIDATOR SHOULD BE DISPLAYED. For this, I used the reference artiicle...
0
2440
by: Gary Shell | last post by:
I am experiencing some strange behavior between a UserControl's validating event and a treeview control. Initially, I thought it was related to an issue in the Knowledgebase article 810852 (http://support.microsoft.com/kb/810852), but then I realized that the hotfix mentioned was in .Net v1.1, which I am using. I took the sample from that article and recreated the situation I see in my application. (Code included below.) If you run the...
5
3930
by: Ryan | last post by:
A binding navigator control adds the following code for when the Save button is clicked: Me.Validate() Me.UserBindingSource.EndEdit() Me.UserTableAdapter.Update(Me.UserDataSet.User)" You can add code to the column changing event for the dataset by using the dataset designer, for example: Private Sub UserDataTable_ColumnChanging(ByVal sender As System.Object, ByVal e As System.Data.DataColumnChangeEventArgs) Handles Me.ColumnChanging If...
0
9645
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10341
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10095
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8979
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7502
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6741
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5383
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5513
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3656
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.