[thelist] OnBlur and CFIF together?

rudy limeback r937 at interlog.com
Wed Jul 19 09:40:40 CDT 2000


> I'm looking for some kind of "generic" onBlur script that in the
> header, will only do function and would allow me to insert the CF
> code of my choice to be executed inside (where the onBlur is used --
> not in the head) -- is this possible??

yup

just remember, all the cf code executes first, <em>before the page
containing the javascript is sent to the browser</em>

> ... but ye gods....  must all this js stuff be SO complicated??

yup   ;o)

> ... looking for a way to use both the js onBlur and CF code
> to do all the validation IN the form.  Possible??

yup, possible, and highly recommended to use both -- just not necessarily
on the same page

you could make your cf action page the same page as the form page (this is
a common cf coding strategy and i think we talked about that recently here,
if not here then over on the other evolt list, "thesite")

in that case i guess you *could* code the cf validation to be located near
the actual form fields, but i wouldn't -- too hokey, i like my code
absolutely clear as to intent, which means i don't often code the form page
*as* the action page

also, as aaron suggested, use onSubmit instead of onBlur

onBlur is so annoying that it can drive people away from your site

you <strong>must</strong> do server-side validation, but if you don't also
do client-side validation, you are shooting yourself in the foot

for one thing, it is way more efficient for the site visitor

also, coming back from the server with an error message means you have to
repopulate the form fields, otherwise the site visitor has to retype even
the valid fields

which is so annoying that it can drive people away from your site


i am *really* late for the office today.....


rudy.limeback
r937.com
evolt.org







More information about the thelist mailing list