Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Selecting a week

Status
Not open for further replies.

izachar

Technical User
Oct 7, 2000
84
CA
I am setting up an application where the user needs to create a schedule based on weeks (changes every Mnoday). They need to select it from a drop down and then based on the week we are in the appropriate information should show automaticlly. Can someone help me out.
 
Hey Izachar,

Could you be a little more specific about what you need help with? It sounds like you need to create a drop down with a number of weeks listed. Do you need to only show weeks from the current week forward and if so, how far forward. Also, when they select a week, do you want the information to immediately appear or appear after they click a button?

GJ
 
Sorry for the unclarity. Yes the menu should be from this coming Monday and have June 25, July 2 untill the end of the year. Based on the week we are in the appropriate information should pull out.
 
Hey Izachar,

I think this will generate the drop down list you need.

<cfset nextMonday=dateadd(&quot;d&quot;,7+2-dayOfWeek(now()),now())>

<cfoutput>
<select name=&quot;scheduleDate&quot;>
<cfloop from=#week(nextMonday)# to=&quot;53&quot; index=&quot;x&quot;>
<option value=&quot;#dateAdd(&quot;ww&quot;,x-week(nextMonday),nextMonday)#&quot;>#dateFormat(dateAdd(&quot;ww&quot;,x-week(nextMonday),nextMonday),&quot;mm/dd/yyyy&quot;)#
</cfloop>
</select>
</cfoutput>

Hope this helps,
GJ
 
Thanks it worked now I have to figure how to asociate the right content with the right week on the output of the content.

Thank you
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top