[Zope] <dtml-var variable> from REQUEST not shown in <input> tag if it has spaces??

Tino Wildenhain tino at wildenhain.de
Thu Aug 4 06:48:37 EDT 2005


Am Donnerstag, den 04.08.2005, 11:33 +0100 schrieb Thomas Apostolou:
> Hello everybody,
> 
> Im using Zope 2.7.0 on Windows XP Pro.
> I pass some parameters from a form to a DTML method.
> Inside that method i try to get the parameters with
> <dtml-var sSQL> ( sSQL is the "name" of the submiting
> form's field).
> When i just use it as <dtml-var sSQL> everything is
> ok.
> When i use it like : <input type="text"
> value=<dtml-var sSQL>>, i get everything until the
> first space. For example from "select * from mytable"
> i get "select".
> 
> Is it something wrong with what i am doing?

Yes, you should write HTML when you want HTML ;)
This means, attribute values in HTML are supposed
to be in " "
(See the HTML source in your Browser when you display
the page and you will know what I mean :)

So, if you really want DTML here, use:

<input type="text" value="<dtml-var sSQL>" />

or 

<input type="text" value="&dtml-sSQL;" />

which is a bit nicer because you dont write a tag inside
a tag.

OR use ZPT:

<input type=text" tal:attributes="value request/sSQL" />





More information about the Zope mailing list