document.getElementsByClassName('form-error');

http://wiki.script.aculo.us/scriptaculous/show/Document.getElementsByClassName

On Jan 10, 10:28 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> just tried this out and it only works if your input has name="form-
> error" not if the form class="form-error". I'm sure there's a way to
> do this though, either by keying off of the class label or setting the
> inputs name to something when it fails validation
>
> On Jan 9, 5:22 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
> wrote:
>
> > well, you can use javascript in the body tag to set the cursor on a
> > given field:
>
> > OnLoad="document.nameofyourform.nameofyourfield.focus();"
>
> > and I believe when the form errors out it sets the class of the form
> > tag to "form-error" so try:
>
> > OnLoad="document.nameofyourform.form-error.focus();"
>
> > On Jan 9, 3:37 pm, pvilas <[EMAIL PROTECTED]> wrote:
>
> > > How can I focus the first invalid field in a form?
>
> > > Thanks.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to