Forum OpenACS Development: Re: Looking for guidance is using template_tag to modify "input" tag

Hi Gustaf

I got a chance to play with your code and it works quite well. A few comments/questions.

I had to add the following to deal with XHTML tags e.g. <input... /> as there was an additional forwardslash key in the attrs dict.
set attrs [dict remove $attrs / ]

The code does modify the original HTML slightly but I don't think this is an isue e.g. 'checked' gets changed to 'checked="checked"'. I haven't tested more complex input fields e.g. ones with onclick or file uploads etc. Ideally it would be great to leave these as-is, but I'm not sure if this is possible?

Another question I have: do you know of any way from within the tag-input proc to pass messages to/from the containing form? My goal here is to remove all hidden input fields from the form, and replace them with a single hidden field whose value will be stored in the session, and which gets submitted in the form.

best wishes
Brian

'checked' gets changed to 'checked="checked"'

to avoid this, handle Boolean attributes separately (as this is necessary also on other places, such as e.g. in the xowiki/tcl/form-field-procs).

... pass messages to/from the containing form
It is possible to overload also "outer" tags, build a stack of such tags with client specific code and query this from the inner tag handlers.

-g

Thanks Gustaf!