Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

Drop Down list boxes showing Current Date?

4 posts in General Discussion (old) Last posting was on 2000-03-29 15:53:16.0Z
^*^GothicCastle^*^ Posted on 2000-03-27 16:16:45.0Z
Newsgroups: sybase.public.easerver
Date: Mon, 27 Mar 2000 17:16:45 +0100
From: ^*^GothicCastle^*^ <^*^GothicCastle^*^@hotmail.com>
X-Mailer: Mozilla 4.7 [en] (Win98; I)
X-Accept-Language: en
MIME-Version: 1.0
Subject: Drop Down list boxes showing Current Date?
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 12
NNTP-Posting-Host: du-006-0246.freeuk.com 212.126.147.246
Message-ID: <347_38DF896D.985C91F1@hotmail.com>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.easerver:25641
Article PK: 155704

Hi,

Can anyone point me in the right direction. I have two sets of drop down
list boxes. The first set shows:
Arrival - Date | Month | Year
Departure - Date | Month | Year

I want the Arrival line to show Today's Date | Today's Month | Today's
Year
and the Departure line to show Tomorrow's Date etc...

I know how to use the GetDate/GetMonth etc... method but I don't know
how I would incoporate this into my HTML code.

Can anyone help?

Davlon


Michael F. Nicewarner [TeamSybase] Posted on 2000-03-27 16:40:35.0Z
Newsgroups: sybase.public.easerver
From: "Michael F. Nicewarner [TeamSybase]" <mike.nicewarner@ibpinc.com>
Subject: Re: Drop Down list boxes showing Current Date?
Date: Mon, 27 Mar 2000 10:40:35 -0600
Lines: 38
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2314.1300
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
NNTP-Posting-Host: secure.ibpinc.com 198.133.192.2
Message-ID: <347_HpB1OvAm$GA.52@forums.sybase.com>
References: <347_38DF896D.985C91F1@hotmail.com>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.easerver:25634
Article PK: 155698

Is this in PowerDynamo? Assuming so, use the Date object and a bit of code
to build the <SELECT> block. Initialize a variable with today's date and
use a for() loop to write out an <OPTION> for each date. The first one will
default to being "selected", but if you want the list ordered backwards, you
can force the current (or tomorrow's) date to be selected with a simple
if().

Does that help?

--

Michael F. Nicewarner [TeamSybase]
mailto:mike.nicewarner@ibpinc.com
http://www.datamodel.org

^*^GothicCastle^*^ <^*^GothicCastle^*^@hotmail.com> wrote in message
news:38DF896D.985C91F1@hotmail.com...
> Hi,
>
> Can anyone point me in the right direction. I have two sets of drop down
> list boxes. The first set shows:
> Arrival - Date | Month | Year
> Departure - Date | Month | Year
>
> I want the Arrival line to show Today's Date | Today's Month | Today's
> Year
> and the Departure line to show Tomorrow's Date etc...
>
> I know how to use the GetDate/GetMonth etc... method but I don't know
> how I would incoporate this into my HTML code.
>
> Can anyone help?
>
> Davlon
>


^*^GothicCastle^*^ Posted on 2000-03-27 17:05:50.0Z
Newsgroups: sybase.public.easerver
Date: Mon, 27 Mar 2000 18:05:50 +0100
From: ^*^GothicCastle^*^ <^*^GothicCastle^*^@hotmail.com>
X-Mailer: Mozilla 4.7 [en] (Win98; I)
X-Accept-Language: en
MIME-Version: 1.0
Subject: Re: Drop Down list boxes showing Current Date?
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 55
NNTP-Posting-Host: du-006-0184.freeuk.com 212.126.147.184
Message-ID: <347_38DF94ED.9470B7FD@hotmail.com>
References: <347_38DF896D.985C91F1@hotmail.com> <347_HpB1OvAm$GA.52@forums.sybase.com>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.easerver:25624
Article PK: 155686

Michael,

Thanks for the reply. This is actually in PowerSite but that doesn't really
matter as it's the code that's important.
Currently, my powersite script would be:

<TD>
<SELECT id="arr_day" name="arr_day">
<OPTION value=01 selected>01</OPTION>
<OPTION value=02>02</OPTION>
<OPTION value=03>03</OPTION>
<OPTION value=04>04</OPTION>
<OPTION value=05>05</OPTION>
</SELECT>
</TD>

Would I have to convert this all into script code to display eg:

<%
var Date=new Date();
Var Daywk= Date.getDay();

document.witeln("<TD>");
document.writeln("<SELECT id='arr_day' name='arr_day'>");
document.writeln("<OPTION value='Daywk' selected>01</OPTION>");
etc...?

You mentioned using a for loop am I going to have to set a loop up to 31 times
for months with 31 days. How would that work?

I appreciate the Date Script that would be needed to grab the current day but
not 100% how this would all fit together.

Davlon

"Michael F. Nicewarner [TeamSybase]" wrote:

> Is this in PowerDynamo? Assuming so, use the Date object and a bit of code
> to build the <SELECT> block. Initialize a variable with today's date and
> use a for() loop to write out an <OPTION> for each date. The first one will
> default to being "selected", but if you want the list ordered backwards, you
> can force the current (or tomorrow's) date to be selected with a simple
> if().
>
> Does that help?
>
> --
>
> Michael F. Nicewarner [TeamSybase]
> mailto:mike.nicewarner@ibpinc.com
> http://www.datamodel.org
>
> ^*^GothicCastle^*^ <^*^GothicCastle^*^@hotmail.com> wrote in message
> news:38DF896D.985C91F1@hotmail.com...
> > Hi,
> >
> > Can anyone point me in the right direction. I have two sets of drop down
> > list boxes. The first set shows:
> > Arrival - Date | Month | Year
> > Departure - Date | Month | Year
> >
> > I want the Arrival line to show Today's Date | Today's Month | Today's
> > Year
> > and the Departure line to show Tomorrow's Date etc...
> >
> > I know how to use the GetDate/GetMonth etc... method but I don't know
> > how I would incoporate this into my HTML code.
> >
> > Can anyone help?
> >
> > Davlon
> >


^*^GothicCastle^*^ Posted on 2000-03-29 15:53:16.0Z
Newsgroups: sybase.public.easerver
Date: Wed, 29 Mar 2000 16:53:16 +0100
From: ^*^GothicCastle^*^ <^*^GothicCastle^*^@hotmail.com>
X-Mailer: Mozilla 4.7 [en] (Win98; I)
X-Accept-Language: en
MIME-Version: 1.0
Subject: Re: Drop Down list boxes showing Current Date?
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 60
NNTP-Posting-Host: m80-mp1-cvx1a.gui.ntl.com 62.252.4.80
Message-ID: <347_38E226EC.308BE5C2@hotmail.com>
References: <347_38DF896D.985C91F1@hotmail.com> <347_HpB1OvAm$GA.52@forums.sybase.com> <347_38DF94ED.9470B7FD@hotmail.com>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.easerver:25368
Article PK: 155466

No panic, sorted it :)

^*^GothicCastle^*^ wrote:

> Michael,
>
> Thanks for the reply. This is actually in PowerSite but that doesn't really
> matter as it's the code that's important.
> Currently, my powersite script would be:
>
> <TD>
> <SELECT id="arr_day" name="arr_day">
> <OPTION value=01 selected>01</OPTION>
> <OPTION value=02>02</OPTION>
> <OPTION value=03>03</OPTION>
> <OPTION value=04>04</OPTION>
> <OPTION value=05>05</OPTION>
> </SELECT>
> </TD>
>
> Would I have to convert this all into script code to display eg:
>
> <%
> var Date=new Date();
> Var Daywk= Date.getDay();
>
> document.witeln("<TD>");
> document.writeln("<SELECT id='arr_day' name='arr_day'>");
> document.writeln("<OPTION value='Daywk' selected>01</OPTION>");
> etc...?
>
> You mentioned using a for loop am I going to have to set a loop up to 31 times
> for months with 31 days. How would that work?
>
> I appreciate the Date Script that would be needed to grab the current day but
> not 100% how this would all fit together.
>
> Davlon
>
> "Michael F. Nicewarner [TeamSybase]" wrote:
>
> > Is this in PowerDynamo? Assuming so, use the Date object and a bit of code
> > to build the <SELECT> block. Initialize a variable with today's date and
> > use a for() loop to write out an <OPTION> for each date. The first one will
> > default to being "selected", but if you want the list ordered backwards, you
> > can force the current (or tomorrow's) date to be selected with a simple
> > if().
> >
> > Does that help?
> >
> > --
> >
> > Michael F. Nicewarner [TeamSybase]
> > mailto:mike.nicewarner@ibpinc.com
> > http://www.datamodel.org
> >
> > ^*^GothicCastle^*^ <^*^GothicCastle^*^@hotmail.com> wrote in message
> > news:38DF896D.985C91F1@hotmail.com...
> > > Hi,
> > >
> > > Can anyone point me in the right direction. I have two sets of drop down
> > > list boxes. The first set shows:
> > > Arrival - Date | Month | Year
> > > Departure - Date | Month | Year
> > >
> > > I want the Arrival line to show Today's Date | Today's Month | Today's
> > > Year
> > > and the Departure line to show Tomorrow's Date etc...
> > >
> > > I know how to use the GetDate/GetMonth etc... method but I don't know
> > > how I would incoporate this into my HTML code.
> > >
> > > Can anyone help?
> > >
> > > Davlon
> > >