472,993 Members | 3,197 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

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 1677
On 13 Dec 2004 11:05:19 -0800, milkyway <d0******@hotmail.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******@hotmail.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.jss">

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.jss">


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.jss">

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.someMadeUpExtenstion">

As long as whats in that file is valid JS code, the browser couldn't
care less what the extension is :-)
--
Randy
comp.lang.javascript 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.someMadeUpExtenstion">

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******@hotmail.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**********************@f14g2000cwb.googlegroups .com>
, dated Mon, 13 Dec 2004 12:25:16, seen in news:comp.lang.javascript,
milkyway <d0******@hotmail.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.demon.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.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.
Jul 23 '05 #10
Flash Nick wrote:
Form Validation bundled with Dreamweaver is pretty basic but works.
That depends, entirely, upon your definition of "works".

99.99% of code generated by Dreamweaver is utterly useless space wasting
garbage. I stopped short of 100% in the hopes that one day they may
actually get a clue about scripting and produce something worth using.

Coding in Dreamweaver is pretty good since it swallowed Homesite.....


Using it as an editor may be "pretty good" but the code it produces is
still garbage.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq
Answer:It destroys the order of the conversation
Question: Why?
Answer: Top-Posting.
Question: Whats the most annoying thing on Usenet?
Jul 23 '05 #11
Thank you for the information ;-) I will try these out

Kindest Regards.

Michael Winter wrote:
On 13 Dec 2004 12:25:16 -0800, milkyway <d0******@hotmail.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 #12
Thanks to all for the help ;-p
Dr John Stockton wrote:
JRS: In article <11**********************@f14g2000cwb.googlegroups .com> , dated Mon, 13 Dec 2004 12:25:16, seen in news:comp.lang.javascript,
milkyway <d0******@hotmail.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 theclient side.

Any ideas?


Read <URL:http://www.merlyn.demon.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.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.

Jul 23 '05 #13
JRS: In article <11**********************@z14g2000cwz.googlegroups .com>
, dated Tue, 14 Dec 2004 21:47:07, seen in news:comp.lang.javascript,
milkyway <d0******@hotmail.com> posted :
Lines: 39 Thanks to all for the help ;-p
Dr John Stockton wrote:
JRS: In article

<1102969516.735695.297080@
... ...

If you think that you may need more help, read and respect FAQ sec 2.3,
especially paragraphs 1 & 6.

--
© 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.
Jul 23 '05 #14
I don't know if anyone is watching this but I found something (don't
know if it is actually good or not) in the struts examples found on the
apache strut website. There are .war files there for examples you can
use to work with struts. One of the examples has a good amount of
javascript code (that is used as part of a form validation example).

You can see the list of packages offered here
http://struts.apache.org/userGuide/installation.html

under the bullet of "Other Packages". Again, *one* of these .war files
has javascript validation code. I think it is the one called
"Validator".

Jul 23 '05 #15

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

Similar topics

17
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...
18
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,...
27
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...
4
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:...
2
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...
12
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...
2
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...
1
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...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
3
SueHopson
by: SueHopson | last post by:
Hi All, I'm trying to create a single code (run off a button that calls the Private Sub) for our parts list report that will allow the user to filter by either/both PartVendor and PartType. On...

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.