| Author |
Validation Browser Test Please!
|
Eric Pascarello
author
Rancher
Joined: Nov 08, 2001
Posts: 15003
|
|
http://www10.brinkster.com/A1ien51/validate/preview.htm I am working on my validation script and want to do some major testing. I have only found 1 error so far in Opera 5 with the dates. All of the fields are filled in with correct default information. The error messages are still being worked on so they will actually make sense in the future! Can you tell me what Operating System and Browser Version. This does NOT work in Netscape 4.X since it does not support my methodology. Thank You Eric Comments welcomed! This is still in the works!
|
 |
Frank Carver
Sheriff
Joined: Jan 07, 1999
Posts: 6913
|
|
Generally pretty comprehensive. I'd still like a more flexible phone number validation for use outside the USA, and I still think basic "mod 10" validation of a credit card number ( see this old thread for code ) would be useful, but those are probably for the next release One "bug": your email validation is a bit aggressive. I have several valid email addresses of the form frank.carver@whatever.co.uk, but your validation seems to object to the "." in the username part. Please check the appropriate RFCs to make sure you are allowing all valid characters. Thanks. Win2K, IE6.0 [ April 28, 2003: Message edited by: Frank Carver ]
|
A Convergent Visionary ~ Frank's Punchbarrel Blog ~ LinkedIn profile
|
 |
Cindy Glass
"The Hood"
Sheriff
Joined: Sep 29, 2000
Posts: 8521
|
|
If you are going to REQUIRE a dash in a 9 char zip code as opposed to a space or just running them together, you should say so. I also have a dot in the first node of some of my e-mails. for 24 hour time it is not clear why 12:12:00 should not work. So I can use this for a cheat sheet - right?
|
"JavaRanch, where the deer and the Certified play" - David O'Meara
|
 |
Jim Yingst
Wanderer
Sheriff
Joined: Jan 30, 2000
Posts: 18652
|
|
I haven't noted many bugs so far. I'm using Mozilla 1.3 and Windows XP. A few notes (mostly composed before seeing other responses): Number validations seem to allow decimal point, but not negative signs. Depending on context, this may or may not make sense. Additional "Validate" buttons at top or middle might be useful - scrolling is tiresome. Being forced to include ( ) in phone numbers is a bit unusual in my experience. I'd typically expect something like "888-555-1234" or "888 555 1243" instead - or even a three-part field which makes the splits for you. I suppose this is OK since you do at least tell people what's expected, but still a bit odd... Error messages might be more informative. E.g. "number of words out of range" - well, what's the range? And how many words do you think I typed? (The latter may be important if there are special chars which may/may not be considered word breaks.) Sure, you can put this in the field labels/instructions too, but sometimes it's preferable to keep the original page simple, and provide more detailed feedback on errors. OK, this sort of thing does increase code length, which may not be desireable - but worth considering, IMO. I can't tell what rules "Enter Starting Date mM/dD/YYYY" is supposed to enforce. Dunno about email(basic). I'd have to check specs for comprehensive rules, but I'm pretty sure there are quite a few valid addresses being rejected here, like foo@yahoo.com.cn or foo@informatik.uni-kl.de. I hope there's a "not-so-basic" version of this that will be offered. I suppose this really goes to the questioning advisability of doing data validation on any field where the full range of possible valid responses is not fully understood. E.g. things like phone or zip - I hope those are only validated that way when the user is known to be in the US, and that other more free-form options will be available to non-US users. Perhaps these considerations are outside the scope of your project, but I think this sort of thing is always worth keeping in mind... Gotta go now; will check more later. [ April 28, 2003: Message edited by: Jim Yingst ]
|
"I'm not back." - Bill Harding, Twister
|
 |
Eric Pascarello
author
Rancher
Joined: Nov 08, 2001
Posts: 15003
|
|
This is going to be a long responce! I did not have the exact specs down for saying what is required. That was just for me then I got tired of testing it and posted it here!...then I thought I would get others to test it since I could not break it. But I see you did!! My first version of this code in my head was just going to have the USA formats down. Then I am going to hit the world formats. I still need to get all of the documentation down so you can see the multiple options for each validation. I have the phone number thing down on another version, but do not have it up yet. It has the ability to look at a bunch of different formats with spaces and such. The (XXX) format was for some guy that emailed me and asked for it from another forum. And I just placed it in my validation script without really thinking of it. The email is making me wonder since it just looks for the @ and . .... I think I know why...lol/...Reg Expressoion is just looking for chars and nums before and not . (I got to remeber _ underscore) too! I guess I was asleep when coding that! For the time I did not think about 12:12:12...That is an easy fix (0\d\d){0,1} the mM thing was just a thing for me to look at. The next version has it so it can force the zero or allow it slip. The current version does not matter if the zero is there and that was what I was trying to say to myself. Ah, the negitive sign is just a reg. exp thing....I remembered it in the money and not there! The money also is only US specific with the dollar sign. Need to get the other sign there too. Jim with the postal code...I started a thread last week in the MD to get some formats. What I was going to do is have it meshed with a drop down and get the format with that. If the country's format was not known, then it would pass it without validation. This is a big project and some people there gave me great links. It is almost an impossible task, but that is what makes it fun! When the country of India is selected, anything will pass!! Want to talk about INSANITY with there addresses. The Big Building Near the little building on the corner. India For the validation button, I was going to have it static on the right hand side of the page so it was always there. I have not gotten around to it. You are my first testers of this! Thank You so much so far. Now I have something to do when the sun goes down. I am also working on all of the error messages. I basically just copied and pasted my way down the code and did not make them dynamic. Going to add vaiables to them. I was worried about getting the basic idea down. So I should have the next update up tonight with eac of these items addressed! Thank You Very Much Eric
|
 |
Jim Yingst
Wanderer
Sheriff
Joined: Jan 30, 2000
Posts: 18652
|
|
I should have noted, it's an impressive collection you've put together. You can be sure I will loot freely from your examples whenever I need something like this. Well, keeping credits intact, so that you may receive a copy of any spam that comes my way. More comments: It might also be useful to trim whitespace from the fields before validating. Sometimes you pick up whitespace while coy & pasting from somewhere else; it can be hard to figure out why "1 " is not a valid number, since the user just sees the "1". (Though a good error message that shows "1 " with quotes will help.) JavaScript doesn't have a built-in trim(), does it? Might be worthwhile to make one, and insert it into all the validators. (Is there ever a case where whitespace should be retained?) Regarding numbers - perhaps there should be a way to specify that an integer is required, as opposed to floating point? Ints are probably more common on most forms, but both may be needed. The 24-hour time currently allows 24 as a value in the hours field - should be 0, right?
|
 |
Eric Pascarello
author
Rancher
Joined: Nov 08, 2001
Posts: 15003
|
|
Okay I updated the following Number - Can use Negitive and Dec.24 Hour Clock allows 12:12:12 and ignores 24:00Zip Code - Allows more formats with spaces, dashes, etc.Email - worked on it, but still needs workPhone Number - allows some other formats Also I added another validate button that is ALWAYS in view so you can stop all of the aditional scrolling! I plan on doing the credit card, I have some JavaScript code for it, just need to edit it to get it to fit in here! Eric
|
 |
 |
|
|
subject: Validation Browser Test Please!
|
|
|