PDA

View Full Version : fValidate testing


beetle
04-25-2003, 03:59 PM
Hey all

Some of you probably know I maintain a pretty decent client-side for validation script, fValidate. I've been rewriting it to be mo' betta and am to the point where I'd like some preliminary testing. Here's the page

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

I've tested it okay in IE6, Opera 7, and Mozilla 1.2.1 -- all on Windows XP. So, if you can test this sucker on any browser/OS combos that I haven't I would be grateful. (In otherwords, I don't need a bunch of posts telling me it works in IE6 :p )

Of course, let me know your setup and any errors you may get.

Borgtex
04-25-2003, 06:02 PM
IE 5.5 - All ok. Nice script

beetle
04-25-2003, 09:08 PM
Thanks Borgtex :thumbsup:

No luv from anybody else? :(

brothercake
04-25-2003, 09:18 PM
Safari is okay.

mac/ie5 throws an error on loading - Line 81, char 16, "Expected ')'" - which leads to "fValidate" being undefined

win/ie5.0 is the same, but it reports a different line number for the error; I'm sure it's the same thing though

beetle
04-25-2003, 09:21 PM
Thanks bcake, I'll look into it right away. :thumbsup:

Do you know which file throws that error? I get the same error in IE5 Win, but for line 63, which is

if ( 'group' in elem )

I wonder if

if ( typeof elem.group != 'undefined' )

Is more kosher. Probably so

brothercake
04-25-2003, 09:22 PM
do you wanna know about opera 6 and ie4 and all those ..?

beetle
04-25-2003, 09:24 PM
I'm curious as to what happens on most any browser

beetle
04-25-2003, 09:31 PM
Yup, I was right. IE 5 didn't like the ( 'prop' in obj ) statements, so I changed all those and works fine!

So, bcake, if you don't mind - lemme know about Opera6, ie5 mac, and ie4

Thanks!

brothercake
04-25-2003, 09:45 PM
Yeah ('prop' in obj) is not good - I did a test page about how unreliable it is - http://www.brothercake.com/Ref/in.html

I'll let you know those other tests ...

brothercake
04-25-2003, 09:50 PM
Opera 6 sort of works ... well it all works, but on every submission you get multiple alerts that say "no element found for label: undefined"

Needless to say, label & append don't work

beetle
04-25-2003, 09:53 PM
Okay then, the routine that adds label properties to the elements isn't working then.

Maybe Opera doesn't recognize label.htmlFor and would prefer label.getAttribute( 'for' );

??

I'll try it and upload it.

added

brothercake
04-25-2003, 09:54 PM
win/ie4 goes "object doesn't support this property or method" at line 136 char 3, and still submits the form empty

brothercake
04-25-2003, 09:57 PM
Originally posted by beetle
Maybe Opera doesn't recognize label.htmlFor and would prefer label.getAttribute( 'for' );
I doubt it personally; label.for might work, but iirc opera 6 doesn't support getAttribute

btw - Opera 5 behaves the same; and both Opera 5 and Opera 6 generate a security confirm every time you read the password field, which it always does.

beetle
04-25-2003, 10:01 PM
Hmm. Seems like Opera 5/6 == really big PITA

The IE4 error was because of getElementsByTagName(), for which I just applied an object sniff

Thanks brothercake, I REALLY appreciate the help. :thumbsup:

Where is a decent reference for me to look up this stuff about Opera?

*skulks off to check liorean's post for a link*

[EDIT] Okay, according to this link (http://www.opera.com/docs/specs/js/), which I think is for older opera versions, getAttribute() is supported for HTMLElement. I'll have to see if I still have Opera 6 on a machine here someplace[/URL]

brothercake
04-25-2003, 10:26 PM
You can still download them from Opera - http://arc.opera.com/pub/opera/

beetle
04-25-2003, 10:40 PM
Ya, I just finished testing on 6.05.

I got it working, but it's just not gonna support the for attribute for labels. That's okay -- most Opera users, I think, have moved to 7 anyways. As long as it doesn't throw errors and stop the form from submitting, I'm cool w/that.

I think I'm finished testing for the day. Thanks for the help you guys.

Still curous about IE Mac

brothercake
04-25-2003, 10:43 PM
Originally posted by beetle
Still curous about IE Mac
Works now :)

liorean
04-26-2003, 12:54 AM
Does the for attribute get written when you change it in Opera 7? In my experience, only a few attributes on a select few tags actually works when setting. For example, id anc class can always be set, but if you try to set type and src attributes of a script tag, it doesn't work. Many other tags exhibit this behavior for most of it's attributes.

beetle
04-26-2003, 01:00 AM
I'm just reading the for attribute so I can create label properties on the form elements.

Basically what you see here (http://www.codingforums.com/showthread.php?s=&threadid=14672)

liorean
04-26-2003, 01:09 AM
Oh. I'll keep quiet, then.
Well, after asking this, anyway: How does Opera<7 react on trying to read elm['for']?

beetle
04-26-2003, 01:25 AM
I got undefined for everything I tried

lbl.htmlFor
lbl['htmlFor']
lbl.getAttribute( 'for' )

None of it worked. Go figure. I'll try lbl['for'] tomorrow and let you know, but I'm not optimistic.

shlagish
04-26-2003, 03:44 AM
Everything works fine in "MyIE2"

tamienne
04-29-2003, 03:29 PM
I tried with NS4 but everytime i try going to the page i Dr Watson pops up. I'll try again later and let you know what i find for NS4

brothercake
04-29-2003, 03:46 PM
Originally posted by tamienne
I tried with NS4 but everytime i try going to the page i Dr Watson pops up. I'll try again later and let you know what i find for NS4
Netscape 4 is not a viable browser - you don't have to (and in my opinion, shouldn't) consider it anymore; treat netscape 4 like netscape 3 - as a legacy browser with no CSS or script support at all.

beetle
04-29-2003, 03:54 PM
Thanks bcake, but I suppose I should at least sniff for it so the durn thing doesn't crash anyone's PC. :rolleyes:

brothercake
04-29-2003, 03:57 PM
Originally posted by beetle
Thanks bcake, but I suppose I should at least sniff for it so the durn thing doesn't crash anyone's PC. :rolleyes:
true ... I'd forgotten that even when you're not considering netscape 4, you still have to consider netscape 4 ...

jkd
04-29-2003, 04:04 PM
Originally posted by brothercake
as a legacy browser with no CSS or script support at all.

I assume you meant DHTML capability. Netscape has had Javascript since 2.0.

brothercake
04-29-2003, 04:33 PM
Originally posted by jkd
I assume you meant DHTML capability. Netscape has had Javascript since 2.0.
I take your point

But what I mean is what I said - "treat netscape 4 like [you would treat] netscape 3 - as [though it were] a legacy browser with no CSS or script support" :p

Caffeine
04-30-2003, 07:17 AM
Sorry for not sticking to the subject here but this is some very nice work!

I was doing this textfield-validator myself the other day, then I stumbled across fValidate and thought; "Hey this is so much better and easier to configure than my script!".
Do I have to say that I'm using fValidate now ?? :)

I have had no troubles so far with IE 5.1 - 6.0.


Great stuff, beetle!

-phleg-

beetle
04-30-2003, 08:49 AM
So, what's the quickest test for NS4?

if ( document.layers )

?? Is that reliable for pretty much sniffing NS4 out?

Thanks phlegmatic -- are you on my mailing list?

brothercake
04-30-2003, 09:34 AM
Originally posted by beetle
if ( document.layers )

?? Is that reliable for pretty much sniffing NS4 out?
Yes - providing that the object test is in the <body> section - if you put in the <head> and the page which contains it is the first page in that browser session, then the object test fails; if you want it to be in the <head> then you have to use navigator information:

var agt=navigator.userAgent.toLowerCase();
if((agt.indexOf('mozilla')!=-1)&&(parseInt(navigator.appVersion)>=4)&&typeof navigator.mimeTypes['*']!="undefined"){

The mimeTypes test is there to prevent Espial Escape and OmniWeb from getting through (because they can spoof as ns4)

beetle
04-30-2003, 01:46 PM
Thanks bcake, I knew you had all that sniffing stuff down. :thumbsup:

brothercake
04-30-2003, 06:51 PM
Originally posted by beetle
Thanks bcake, I knew you had all that sniffing stuff down. :thumbsup:
Yeah it's a relic from my sordid past ;) I have a little sniffer script I use for when I need one - http://www.brothercake.com/scripts/sniffer.php