Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / ASP / Database Access / October 2007



Tip: Looking for answers? Try searching our database.

Drop down list

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
navin - 25 Oct 2007 19:28 GMT
Hi All,

In a drop down box i am populating all the weeks from 1 to 52,  but
whenever the page loads, i want it show the current week number as
selected value.

Below is what is did:

<option selected value="<% DatePart("ww", Now()) %>"> <% wkCnt %> </
option>

But when my page loads, the drop down box shows the last week in the
list (52), instead of current week which is 43.

please let me know i am missing something.

appreciate any ideas on this.

Thank you!!

Navin
Bob Barrows [MVP] - 25 Oct 2007 19:45 GMT
> Hi All,
>
[quoted text clipped - 9 lines]
> But when my page loads, the drop down box shows the last week in the
> list (52), instead of current week which is 43.

View Source to see the actual output.of you server-side code. If that
does not provide the clue for you, you need to show us how to reproduce
the symptom: show us the rest of the code to generate the options.

Bob Barrows
Signature

Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.

navin - 25 Oct 2007 22:33 GMT
On Oct 25, 11:45 pm, "Bob Barrows [MVP]" <reb01...@NOyahoo.SPAMcom>
wrote:
> > Hi All,
>
[quoted text clipped - 22 lines]
>
> - Show quoted text -

I am using the below code to populate the drop down with all the 52
weeks.

<p><select size="1" name="actDate">
            <%
            Dim wkCnt

            for wkCnt = 1 to 52
            %>
            <option selected value="<% DatePart("ww", Now()) %>"> <% wkCnt %> </
option>
            <% Next %>

            </select></p>

thanks,
Navin
McKirahan - 25 Oct 2007 23:32 GMT
> On Oct 25, 11:45 pm, "Bob Barrows [MVP]" <reb01...@NOyahoo.SPAMcom>
> wrote:
[quoted text clipped - 39 lines]
>
> </select></p>

Perhaps you want the following:

<p>
<select name="actDate" size="1">
<%  Dim wkCnt, wkNow
   For wkCnt = 1 To 52
       wkNow = ""
       If wkCnt = DatePart("ww",Now) Then wkNow = " selected"
%>
<option value='" & wkCnt & "'" & wkNow & ">" & wkCnt & "</option>"
<%  Next %>
</select>
</p>
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.