cool, just for completeness though:
when upgrading from woody to cforms (which is highly recommended) you
should:
watch out with those on_load thingies, you might be killing the
necessary onload of other widgets in the form (e.g. used by advanced
widgets like calendar or html area and whatnot)
the way to add your own code to the 'onload' event is therefor a bit
different when you use the provided xsl's from samples/resources
forms_onloadHandlers[forms_onloadHandlers.length] =
document.login.id.focus; // not tested, so might have some syntax issues
see the forms_onloadHandlers Array declared and used in form_lib.js
http://cvs.apache.org/viewcvs.cgi/cocoon/trunk/src/blocks/forms/samples/resources/forms-lib.js?rev=36594&root=Apache-SVN&view=auto
HTH
-marc=
[EMAIL PROTECTED] wrote:
We found out how to do it yesterday: give the template a name-attribute
(e.g. login) and the body tag an onload attribute
with value: document.nameOfForm.NameOfField.focus()
Regards,
Robby
Access Control
Login
${message}
action="continuation:${cocoon.continuation.id}"
method="POST"
name="login">
Login
-Original Message-
From: Ulf Sahlin [mailto:[EMAIL PROTECTED]
Sent: 08 September, 2004 09:48
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: Woody question (how to give certain field focus at onload
of document)
Hello Robby!
You could try some element in the form
template, since all attributes to that element is copied into the resulting
input tag in the standard cforms field transformer:
...
...
Another option would be to include a simple javascript in the template that
does the focusing job.
Regards,
Ulf Sahlin
-Ursprungligt meddelande-
Från: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Skickat: den 7 september 2004 15:46
Till: [EMAIL PROTECTED]
Ämne: Woody question (how to give certain field focus at onload of
document)
Hi,
anyone who knows how to give a woody field (input field) focus
when the page
is loaded ?
Kind regards,
Robby
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
Marc Portierhttp://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
Read my weblog athttp://blogs.cocoondev.org/mpo/
[EMAIL PROTECTED] [EMAIL PROTECTED]
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]