[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).&nbsp; 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>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&lt;select =
name=3D"start_month"&gt;<BR>&lt;dtml-in=20
"1,2,3,4,5,6,7,8,9,10,11,12"&gt;<BR>&lt;dtml-if&nbsp;"some_split_of_date_=
string_to_get_month(start_date)&nbsp;=3D=3D=20
_['sequence-item']"&gt;<BR>&lt;option value=3D"&lt;dtml-var =
sequence-item&gt;"=20
selected&gt;&lt;dtml-var=20
sequence-item&gt;&lt;/option&gt;<BR>&lt;dtml-else&gt;<BR>&lt;option=20
value=3D"&lt;dtml-var sequence-item&gt;"&gt;&lt;dtml-var=20
sequence-item&gt;&lt;/option&gt;<BR>&lt;/dtml-if&gt;<BR>&lt;/dtml-in&gt;<=
BR>&lt;/select&gt;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>??</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;</DIV>
<DIV><BR>Thanks!</DIV>
<DIV>&nbsp;</DIV>
<DIV>Mike Kelland</DIV>
<DIV><A =
href=3D"mailto:mike@studiomatic.com">mike@studiomatic.com</A></DIV>
<DIV>&nbsp;</DIV></FONT></BODY></HTML>

------=_NextPart_000_0057_01C05E0D.455F8E90--