Empty attributes in form tags

Konrad Mauz <kmauz-5HlQSm0/[email protected]> Wed, 5 Dec 2007 09:16:13 +0100
Newsgroups gmane.comp.python.spyce.general
Message-ID <[email protected]>
Hi all,

I'm looking for a simple way to switch input fields from
readwrite to readonly. The readonly attribute for <input ...> tags
is an attribute without value. 

The following code does not work:

--- schnipp ---
[[\
computername = "mycomp"
if ( mySwitch ):
	ro="readonly"
else:
	ro=""
]]

<f:text name="cname" value="=computername" ="=ro" />
--- schnapp ---

If mySwitch is True this should render to:

<input type="text" name="cname" value="mycomp" readonly />

if mySwitch is False this should render to:

<input type="text" name="cname" value="mycomp" />

How can I insert valueless attributes in form tags without using
if, elif, else? Is it possible?

Regards Konrad
-- 
Konrad Mauz 
Rechenzentrum
Hochschule Technik, Wirtschaft und Gestaltung
Braunegger-Strasse 55, D 78462 Konstanz                                         
e-mail: kmauz-5HlQSm0/[email protected]
Tel.:   +49 7531 206-472
Fax.:   +49 7531 206-153

-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4