Form Variable Types, special: record literals
in a DTML-Document i have <form name="check" action="<dtml-var document_id>" method="GET" > <input type="text" name="person.fname:record:string" value="???" /> <input type="text" name="person.lname:record:string" value="???" /> (actually abt. 20 fields). <input type="submit" value=" Check " /></form> i want to initialize person once so that i can write <input type="text" name="person.lname:record:string" value="person.lname" /> (or, <dtml-with person> <input type="text" name="person.lname:record:string" value="lname" /> </dtml-with> ) to avoid writing <input type="text" name="person.fname:record:string" value="<dtml-if "REQUEST.has_key('person')><dtml-var person.fname> <dtml-else><dtml-var "">" /> 20 times. Using 2 DTML-Documents could mean "layout drift" between 2 documents which should look equal. Is there a way to initialize a record via <dtml-call "REQUEST.set( )"> or any other elegant solution?
hans wrote:
in a DTML-Document i have
<form name="check" action="<dtml-var document_id>" method="GET" > <input type="text" name="person.fname:record:string" value="???" /> <input type="text" name="person.lname:record:string" value="???" /> (actually abt. 20 fields). <input type="submit" value=" Check " /></form>
i want to initialize person once so that i can write <input type="text" name="person.lname:record:string" value="person.lname" />
...
to avoid writing <input type="text" name="person.fname:record:string" value="<dtml-if "REQUEST.has_key('person')><dtml-var person.fname> <dtml-else><dtml-var "">" /> 20 times. Using 2 DTML-Documents could mean "layout drift" between 2 documents which should look equal. Is there a way to initialize a record via <dtml-call "REQUEST.set( )"> or any other elegant solution?
i overlooked the dtml-var missing attribute <input type="text" name="person.lname:record:string" value="<dtml-var person.lname missing=""> />
participants (1)
-
hans