[Kss-devel] Changing a form selection
Hedley Roos
hedley at upfrontsystems.co.za
Sun Mar 25 14:13:15 CEST 2007
> Thank you for the information. Is there a way to get the current
> options through kss? I could use replaceHtml(), but I wouldn't want
> to hardcode the options since they may change. I didn't see any
> commands in kss that could read in the options so I could modify them.
>
I assume you already use a tal:loop in your template to iterate over the
options.
As far as I know you cannot pass the entire html select snippet through
KSS, and that is bad design in any case.
What I do is to put a matal:macro around my tal:loop in the page
template, then from within my Python script I call that macro to obtain
the new options as html, and then I pass that html back with
core.replaceInnerHTML for the select tag.
The benefit is template re-use and you do not pollute your script with
markup.
If you need an example let me know.
More information about the Kss-devel
mailing list