[Zope] string splitting in dtml
Mike Kelland
mike@studiomatic.com
Mon, 4 Dec 2000 16:14:25 -0500
This is a multi-part message in MIME format.
------=_NextPart_000_0057_01C05E0D.455F8E90
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
I have a date string (ie dd/mm/yy) which I'm drawing out of a database =
(ODBC connection to Access) with a Z SQL method and I need to use that =
data to set the initial condition of a set of 3 select items (ie day, =
month and year). Is there a way to split this date (it'll come out =
looking like dd/mm/yy) to get the components of it so that I can do:=20
<select name=3D"start_month">
<dtml-in "1,2,3,4,5,6,7,8,9,10,11,12">
<dtml-if "some_split_of_date_string_to_get_month(start_date) =3D=3D =
_['sequence-item']">
<option value=3D"<dtml-var sequence-item>" selected><dtml-var =
sequence-item></option>
<dtml-else>
<option value=3D"<dtml-var sequence-item>"><dtml-var =
sequence-item></option>
</dtml-if>
</dtml-in>
</select>
??
Thanks!
Mike Kelland
mike@studiomatic.com
------=_NextPart_000_0057_01C05E0D.455F8E90
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.4134.600" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>I have a date string (ie dd/mm/yy) =
which I'm=20
drawing out of a database (ODBC connection to Access) with a Z SQL =
method and I=20
need to use that data to set the initial condition of a set of 3 select =
items=20
(ie day, month and year). Is there a way to split this date (it'll =
come=20
out looking like dd/mm/yy) to get the components of it so that I can do: =
</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2><select =
name=3D"start_month"><BR><dtml-in=20
"1,2,3,4,5,6,7,8,9,10,11,12"><BR><dtml-if "some_split_of_date_=
string_to_get_month(start_date) =3D=3D=20
_['sequence-item']"><BR><option value=3D"<dtml-var =
sequence-item>"=20
selected><dtml-var=20
sequence-item></option><BR><dtml-else><BR><option=20
value=3D"<dtml-var sequence-item>"><dtml-var=20
sequence-item></option><BR></dtml-if><BR></dtml-in><=
BR></select></FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>??</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2> </DIV>
<DIV><BR>Thanks!</DIV>
<DIV> </DIV>
<DIV>Mike Kelland</DIV>
<DIV><A =
href=3D"mailto:mike@studiomatic.com">mike@studiomatic.com</A></DIV>
<DIV> </DIV></FONT></BODY></HTML>
------=_NextPart_000_0057_01C05E0D.455F8E90--