473,657 Members | 2,351 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Good validation package

Hello,

Is there a good validation package out there that can be used with
javascript? I have tried the one here:

http://www.peterbailey.net/fValidate/

but had some problems implementing it ;-(

I have seen the one from Dreamweaver but I am not using this package.

Is there anything else out there that one can use?
Any help, hints or advice would be appreciated ;-)

TIA

Jul 23 '05 #1
14 1717
On 13 Dec 2004 11:05:19 -0800, milkyway <d0******@hotma il.com> wrote:

[snip]
I have tried the one here:

http://www.peterbailey.net/fValidate/

but had some problems implementing it ;-(
I'm somewhat glad. Serving up over 50KBs of code to validate a few form
controls is stupid.
I have seen the one from Dreamweaver but I am not using this package.
Most of the code I've seen generated by Dreamweaver is rubbish. I'd be
surprised if the form validation stuff is any better.
Is there anything else out there that one can use?
What are you actually trying to validate? It's far more sensible to use
something small and efficient.
Any help, hints or advice would be appreciated ;-)


On a different topic, please post to appropriate newsgroups. This solution
has nothing to do with Java, and ciwah deals with authoring HTML on the
Web not scripting.

Follow-ups set to c.l.js.

Mike

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.
Jul 23 '05 #2
HI - sorry about the posting. Just still learning all of this.

I am trying to validate data for: strings, numbers, money, social,
phone number, date and zipcode.

I had thought that there would be a way to validate these things on the
client side.

Any ideas?

Kind Regards.

Jul 23 '05 #3
Michael Winter wrote
On 13 Dec 2004 11:05:19 -0800, milkyway <d0******@hotma il.com> wrote:

[snip]
I have tried the one here:

http://www.peterbailey.net/fValidate/

but had some problems implementing it ;-(


I'm somewhat glad. Serving up over 50KBs of code to validate a few form
controls is stupid.
I have seen the one from Dreamweaver but I am not using this package.


Most of the code I've seen generated by Dreamweaver is rubbish. I'd be
surprised if the form validation stuff is any better.
Is there anything else out there that one can use?


What are you actually trying to validate? It's far more sensible to use
something small and efficient.
Any help, hints or advice would be appreciated ;-)


On a different topic, please post to appropriate newsgroups. This solution
has nothing to do with Java, and ciwah deals with authoring HTML on the
Web not scripting.

Follow-ups set to c.l.js.

Mike

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.


When the javascript is included with the

<link rel="script" type="text/javascript" href="URI/xxx.js">

<LINK REL="STYLESHEET " TYPE="TEXT/JAVASCRIPT" HREF="classes.j ss">

Tag, then the javascript exists only one time on the the client.

see at

http://www.iota-six.co.uk/html/14_jss.htm

search over ctrl f 'link'

--
Heiner Kuecker
Internet: http://www.heinerkuecker.de http://www.heiner-kuecker.de
JSP WorkFlow PageFlow Page Flow FlowControl Navigation: http://www.control-and-command.de
Java Expression Formula Parser: http://www.heinerkuecker.de/Expression.html
CnC Template Technology http://www.heinerkuecker.de/Expression.html#templ
Jul 23 '05 #4
On Mon, 13 Dec 2004 23:30:47 +0100, Heiner Kücker <Ma**@Heiner-Kuecker.de>
wrote:

[snip]
When the javascript is included with the

<link rel="script" type="text/javascript" href="URI/xxx.js">
Excuse me? You don't include scripts with LINK elements.
<LINK REL="STYLESHEET " TYPE="TEXT/JAVASCRIPT" HREF="classes.j ss">


As far as I'm aware, only Netscape supports JSS, so what is the point?

[snip]

Mike

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.
Jul 23 '05 #5
Michael Winter wrote:
On Mon, 13 Dec 2004 23:30:47 +0100, Heiner Kücker
<Ma**@Heiner-Kuecker.de> wrote:

[snip]
<LINK REL="STYLESHEET " TYPE="TEXT/JAVASCRIPT" HREF="classes.j ss">

As far as I'm aware, only Netscape supports JSS, so what is the point?


What does and doesn't support JSS is irrelevant though, is it not?

<script type="text/javascript" src="someFile.s omeMadeUpExtens tion">

As long as whats in that file is valid JS code, the browser couldn't
care less what the extension is :-)
--
Randy
comp.lang.javas cript FAQ - http://jibbering.com/faq
Jul 23 '05 #6
On Mon, 13 Dec 2004 17:56:43 -0500, Randy Webb <Hi************ @aol.com>
wrote:

[snip]
What does and doesn't support JSS is irrelevant though, is it not?
I think that the poster was, for some reason, referring specifically to
Javascript Style Sheets. Why? I don't know.
<script type="text/javascript" src="someFile.s omeMadeUpExtens tion">

As long as whats in that file is valid JS code, the browser couldn't
care less what the extension is :-)


I know that! :P

Mike

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.
Jul 23 '05 #7
On 13 Dec 2004 12:25:16 -0800, milkyway <d0******@hotma il.com> wrote:
HI - sorry about the posting. Just still learning all of this.

I am trying to validate data for: strings, numbers, money, social, phone
number, date and zipcode.
You're going to have to be more specific than that, especially considering
that I'm in a different country than you. I've had a quick look for
US-specific formats, but I might be the victim of misinformation.

- Strings
Are you just looking for strings that aren't zero-length or
composed solely of white-space, or more complex? The former would
be

/^\S+$/ or /^\S+( \S+)*$/

if you want a space-separated sequence.

- Numbers
Easy, but again varied.

- Integers? /^(0|[1-9]\d*)$/
- Reals? /^(0|[1-9]\d*)\.\d+$/
- Possibly both? /^(0|[1-9]\d*)(\.\d+)?$/

- Money
/^(0|[1-9]\d*)(\.\d\d)?$/

though you might want to limit the number of digits before the
decimal place.

- Social (Security?)
/^\d{3}-\d\d-\d{4}$/

- Phone number
Phone numbers are notoriously difficult as different systems,
even within the same country, can vary. If you have to deal with
international numbers, you're in for a real treat.

- Date
Which format(s)? If you expect international audiences, a
locale-specific format such as mm/dd/yyyy is generally a bad idea.

- Zipcode
/^\d{5}$/ or /^\d{5}(-\d{4})?$/

for optional inclusion of the extra four digits

To use the regular expression literals above, you'd append

.test(...)

where the ellipses represents a string value. For example,

if(/^(0|[1-9]\d*)$/.test(str)) {
/* The string, str, contains a valid integer. */
}
I had thought that there would be a way to validate these things on the
client side.


Undoubtably, but if you haven't so far, worry about validation on the
server first. That's more important.

Mike

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.
Jul 23 '05 #8
Form Validation bundled with Dreamweaver is pretty basic but works.

There are extensions that are available at Macromedia's Exchange that
plug into Dreamweaver and are more robust and if you don't like anything
you find you can always use your own Form Validation code in
Dreamweaver. Coding in Dreamweaver is pretty good since it swallowed
Homesite.....

--
FN
Jul 23 '05 #9
JRS: In article <11************ **********@f14g 2000cwb.googleg roups.com>
, dated Mon, 13 Dec 2004 12:25:16, seen in news:comp.lang. javascript,
milkyway <d0******@hotma il.com> posted :
HI - sorry about the posting. Just still learning all of this.
Read the newsgroup FAQ.
I am trying to validate data for: strings, numbers, money, social,
phone number, date and zipcode.

I had thought that there would be a way to validate these things on the
client side.

Any ideas?


Read <URL:http://www.merlyn.demo n.co.uk/js-valid.htm>.

You do not indicate what country you are in, so can be supposed to be
American. Remember overseas customers, and non-USA Americans. Even if
you supply only within the USA, you customers may be using a non-US
location. Do not over-validate.

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

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

Similar topics

17
8281
by: Phil Powell | last post by:
Where can I find an online PHP form validator script library to use? I have tried hacking the one here at work for weeks now and it's getting more and more impossible to customize, especially now with form elements that turn out to be arrays that have to be compared with one another! I have one form element, languages, a checkbox group. Beside each checkbox is a dropdown, proficiency (which will become proficiency alongside languages)....
18
21419
by: Dave W | last post by:
I wish to validate a string but i'm not quite sure how to go about doing it. I'd like to ensure that it is 9 characters long and in the following format. "LL 00 LLL" - Thats letter, letter, space, number, number, space, letter, letter, letter) The letter sections mustn't contain numbers and is inputed from a string. Any help greatly appreciated, including further reading from website.
27
2261
by: Matt Kruse | last post by:
Since this topic has come up several times in other threads, I thought I'd make a separate thread and gather opinions from (hopefully) a more varied range of newsgroup participants. What are your thoughts on the development and use of generalized, reusable javascript libraries? Discussion points: 1) Is the overhead of a 25k (for example) .js file too much for a typical
4
2579
by: bienwell | last post by:
Hi, I have a problem and really need your help. In my web page ASPX, I have some text fields to accept data from users. I did form validation like this : <td class="dataTD" style="HEIGHT: 30px" width="100"> <asp:TextBox id="txtFUEL_ISSUED1" style="Z-INDEX: 100; POSITION: absolute" runat="server" Width="107px" BorderColor="Transparent" autoPostback="true"
2
7567
by: Marcin Cenkier | last post by:
Hi, I want to validate a DOM document, and if I build DOM from a stream using documentBuilder.parse() validation using validator.validate(DOMSource) works, but if I create the same document manually then validation throws an exception: org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of element ....
12
2041
by: Dabbler | last post by:
I need to insure that at least one of three phone number fields has a value (requiredfield) but I'm not sure of a way to implement this without server side logic. Is there a way to use the validation controls to do this? Thanks.
2
3771
by: steadyspirit | last post by:
I'm now using STG XML validation tool to validate my XML files through uploading. But, STG can not include local DTD files. Also, testing XML files on Firefox and IE always lead to inconsistent results, which is really a confusion to me. Are there any good XML validation tool to introduce?
1
11525
by: NamelessNumberheadMan | last post by:
I can't seem to get Struts 2 validations to work. I have been converting from Strust 1 to Struts 2. So far I've refactored all the code (for this particular module) on the back end, rewrote the jsp using Struts 2 notations, and wired up the xml (aside from the abc-validation.xml). Everything runs just fine. If there is an error not generated by user input (i.e. file format problem) I can get that message to come out, so I know my error messages...
0
8732
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8504
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
8606
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7337
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
6169
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
5632
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
4318
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2732
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1622
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.