Hi,
I have worked out
how to store cookies and retreive them in DTML to store preferences on a
form.
Question.
If the cookie isn't
there yet or gets deleted/rejected etc. How do I insert a default value into the
name space?
What I need is
something like...
if <thing>
isn't there then <thing>=some default value.
What would solve my
problems would be if <dtml-let> didn't need a closing
</dtml-let>.
Background...
This cookie is used
to enter a preference value in a form, thus...
<tr>
<th
align="left">Batch Size</th>
<td><input
type='integer' name='batch_size:int'
size=2
value="&dtml.missing-batch_size;"
/></td>
</tr>
When the form is
entered the cookie is set to the value inserted by the user,
thus...
<dtml-if
"REQUEST.has_key('batch_size')">
<dtml-call
"RESPONSE.setCookie('batch_size', batch_size, expires='Wed, 19 Feb 2020 14:28:00
GMT')">
</dtml-if>
When the user comes
back to the form, the value of batch_size is magically read from the cookie as a
default again.
Problem...
The form is called
for the first time so there is no cookie. How do I set batch_size to a default
value?
Regards,
Simon.