473,396 Members | 2,076 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,396 software developers and data experts.

verify info in order fom

i am looking for help on how to verify information in a form so that
the following info has to be filled in before they click on submit. I
am not an expert in java or html so any help would be greatly
appreciated.

Name
Address
City
State
Zip
Email
Phone

p.s.-The page that this info is on is an .html page.

Sep 22 '05 #1
6 1591
<jo***@jtphotoservice.com> wrote in message
news:11**********************@g44g2000cwa.googlegr oups.com...
i am looking for help on how to verify information in a form so that
the following info has to be filled in before they click on submit. I
am not an expert in java or html so any help would be greatly
appreciated.

Name
Address
City
State
Zip
Email
Phone

p.s.-The page that this info is on is an .html page.


To what extent do you want to verify the data?

Some validation tests include:
a) minimum number of characters.
b) presence/absence of certain characters.
c) drop-down lists to ensure validity; (e.g. State).

Regular expressions are often used for some items.

If someone wants to put in bad data they can:

John Q. Public
12345 Archer Avenue
Lemont
IL
60439
jq*@aol.com
630-685-0000

Is the above valid or not? How can you tell?
Sep 22 '05 #2
ASM
jo***@jtphotoservice.com wrote:
i am looking for help on how to verify information in a form so that
the following info has to be filled in before they click on submit. I
am not an expert in java or html so any help would be greatly
appreciated.

Name
Address
City
State
Zip
Email
Phone

p.s.-The page that this info is on is an .html page.


if you use only text fields

<script type="text/javascript">
function verif(aForm) {
for(var i=0;i<aForm.length;i++)
if(aForm[i].type == 'text' && aForm[i].value=='')
{
alert('Field : '+aForm[i].name+' is empty');
aForm[i].focus();
aForm[i].select();
return false;
}
return true;
}
</script>

<form onsubmit="return verif(this)" blah >

--
Stephane Moriaux et son [moins] vieux Mac
Sep 22 '05 #3
just so that the boxes aren't left blank...if the info they enter is
wrong, i will deal with that seperately

Sep 22 '05 #4
so would i have to change this line

alert('Field : '+aForm[i].name+' is empty');

to where "name" is replaced with "address", "phone", and so on.

i know how to create pages but i am new to all the stuff that happens
behind the scenes so to speak.

Sep 22 '05 #5
ASM
johnt wrote:
so would i have to change this line

alert('Field : '+aForm[i].name+' is empty');

to where "name" is replaced with "address", "phone", and so on.
here 'name' is the name of the field (the input type=text)
that's to say : 'Name', 'Address' 'Phone' or whatelse you did

so this alert displaies automaticaly the right message
then the right field is reach and shown
then submit is stoped
(except if something was entered in the field)
i know how to create pages but


you have only to copy-paste what I have given
in html code of your page (*)
Don't forget the onsubmit=blah in your tag 'form'

nothing more to add and anything to change
if you only need to prevent blank fields

do that and try it
(*) beter to put the javascript in header
but it can be anywhere you want

--
Stephane Moriaux et son [moins] vieux Mac
Sep 22 '05 #6
JRS: In article <11**********************@g44g2000cwa.googlegroups .com>
, dated Thu, 22 Sep 2005 06:41:53, seen in news:comp.lang.javascript,
jo***@jtphotoservice.com posted :
i am looking for help on how to verify information in a form so that
the following info has to be filled in before they click on submit. I
am not an expert in java or html so any help would be greatly
appreciated.


Firstly, read the newsgroup FAQ; all of it. By the time you get to the
end, you should have learned that Java is not javascript.

For field validation, see
<URL:http://www.merlyn.demon.co.uk/js-valid.htm>.

--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 IE 4 ©
<URL:http://www.jibbering.com/faq/> JL/RC: FAQ of news:comp.lang.javascript
<URL:http://www.merlyn.demon.co.uk/js-index.htm> jscr maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.
Sep 22 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Ian Rastall | last post by:
Ah, I hope it's okay to keep posting questions, and sorry for the vague subject line. This is my problem: I've got a database set up with 7 fields: ID, Album, Year, Type, Songs, Members,...
7
by: ivan_oj28 | last post by:
Hi, I am developing an application where I need to read the caller id from an incoming call. The only info (for now) I need is the caller id info, so that I can display the propper caller info on...
4
by: Reader | last post by:
I have an application that allows a user to enter a user name, user password, and the domain or machine name. From this information I would like to verify the user account and password is valid. ...
0
by: Support | last post by:
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40"> <head>...
23
by: Han | last post by:
Our app runs on end-users machines (apache2.x + php5). At this moment it is quite easy for someone (who has access to the console) to insert a couple lines of php code to steal sensitive info. ...
1
by: pm a | last post by:
Hi, I'm writing code on username and password verify. A remote device will send the 2 info and my code has to verify if it's a valid Windows user in a system. How can I do this? I appreciate for...
2
by: Martin | last post by:
Hi, I have implemeted a recursive function that basically iterate throught the entire file system and prints out the entire path of each directory that it come across. The only problem is the...
2
by: yxq | last post by:
Hello, I want to verify the digital signature of EXE or DLL file, in order to know if they published by Microsoft, like the software "Process Explorer", download link is below...
8
by: Christina123 | last post by:
Currently working with Microsoft Office 2000 and whatever version of Access came with that. I am developing a database to track the comings and goings of shared tools. Everything works...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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...

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.