![]() |
I am using this php code to generate a month/day/year pull down menu but I cannot set it to pull previous years from the pulldown, only the current year + . Any ideas on how to resolve this?
Here is the area in question: Code:
// generate year drop-down Code:
// function to format DATE values Many TIA's to any who reply :) /JD |
Hey JacKDynne,
So your code right now will post from this year and up, not past years correct? The issue falls within this statement: Code:
for ($x=$currYear; $x<($currYear+5); $x++) If you were to set the limit to look like this $x<($currYear-5), this still doesn't work (as you already noticed), because the current year has already succeeded the limit (being you are comparing the current year,($x, with being less than 5 years before the current year) which makes this statement already false, therefore, no years should have been posted when you have tried that out... I think what you can do is this, to get at least 5 years before the current year: Code:
for ($x=$currYear-5; $x<($currYear+5); $x++) See if this helps, if not, let me know and I'll look into it further... -SlickVic78 |
You rock SlickVic :)
That was just about the only variation I did not try :lol: Thanks for the help m8 - I appreciate it :) /JD |
All times are GMT +1. The time now is 11:10 AM. |
Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.