[Bese-devel] Re: Forms, how to make them

Marco Baringer mb at bese.it
Thu Jun 22 11:59:24 UTC 2006


Pupeno <pupeno at pupeno.com> writes:

> Hello,
> I have made a simple component with a some fields and now I want it to
> be a form, I've tried two ways which lead to different problems.
> In-CL markup, so I build the form like:
>
> (<:p (<:label "Name: " (render (account-name form))))
> (<:p (<:label "Email address: " (render (account-email form))))
> (<:p (<:label "Password: " (render (account-password form)))))
>
> Now, for example, how do I put an "accesskey" parameter to the generated
> input elements ?

form elements don't currenty support the accesskey parameter, adding
them is an excellent idea.

> I am ok with automatically generated ids and names, but, do they have to
> be randomly generated ? It breaks the useful browser feature of
> auto-completation.

the ids can be changed with the :dom-id initarg (slot defined by the
html-element class) and the name can be set with the :name initarg
(slot defined by the generic-form-element).

> Then I tried using TAL (with which I am confortable since my days as a
> Zope developer), but there, how do I generate the input elements ?
> and/or can I write them myself (to have the right names and the right
> parameters, like "account-name" and "n" for the first field in the
> previous example) ? Is it possible to still have all that javascript
> voodoo still in place ?

the javascript vodoo is generated by the form elements only, if you
don't use the form elements you don't get the javascript, sorry.

-- 
-Marco
Ring the bells that still can ring.
Forget your perfect offering.
There is a crack in everything.
That's how the light gets in.
	-Leonard Cohen




More information about the bese-devel mailing list