[ZPT] select, option, selected in ZPT?
Jim Kutter
jim@ebizq.net
Wed, 19 Jun 2002 09:55:00 -0400
This is a multi-part message in MIME format.
------=_NextPart_000_001C_01C21777.603DB8C0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hi Folks
I'm trying to figure out how to retain form data after a post (in the =
event of an error of some sort) so I fill in the values of the form with =
what was passed. For example, a registration process that must do a DB =
query and return the same form if the username is already taken so the =
user can pick another without filling out the whole thing again.
How would I add the "selected" attribute to an <option> html tag in zpt? =
Does the tal:attribute method work? If so, wouldn't I need to tell it =
what attribute to assign a value to?
Basically I want to do this in pseudocode
while (dropdown)
if dropdown[n] =3D=3D options.dropdown_from_post:
<option "selected">Blah</option>
else:
<option>Blah not selected</option>
Thanks
-jim
------=_NextPart_000_001C_01C21777.603DB8C0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 5.50.4912.300" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Hi Folks</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>I'm trying to figure out how to retain =
form data=20
after a post (in the event of an error of some sort) so I fill in the =
values of=20
the form with what was passed. For example, a registration process that =
must do=20
a DB query and return the same form if the username is already taken so =
the user=20
can pick another without filling out the whole thing again.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>How would I add the =
"selected" attribute to an=20
<option> html tag in zpt? Does the tal:attribute method work? If =
so,=20
wouldn't I need to tell it what attribute to assign a value =
to?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Basically I want to do this in=20
pseudocode</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>while (dropdown)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>if dropdown[n] =3D=3D=20
options.dropdown_from_post:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2> <option=20
"selected">Blah</option></FONT></DIV>
<DIV><FONT face=3DArial size=3D2>else:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2> <option>Blah =
not=20
selected</option></FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Thanks</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>-jim</FONT></DIV></BODY></HTML>
------=_NextPart_000_001C_01C21777.603DB8C0--