Display message or button dependent on datetime
Posted: Mon Oct 19, 2009 8:49 pm
Hello everyone,
I have a form that adds an item to a shopping cart. The user would like her items available only during certain parts of the day as she delivers the items same day, and only certain items are available on certain days.
So her shopping page looks something like this (each item is it's own form, and the buy now button submits the form):
Monday: Item 1 <buy now button>
Tuesday: Item 2 <buy now button>
Wednesday: Item 3 <buy now button>
and so on
Let's say the cutoff time is 10am
On Sunday, you will see all items with the buy now buttons. On Monday, if it's before 10am, you will see everything.
On Monday at 10:01am you will see
Monday: Item 1 "Sorry this is no longer available to order today"
Tuesday: Item 2 <buy now button>
Wednesday: Item 3 <buy now button>
So I need to either display the buy now button (which submits the form), or show a message. Which one is shown is based on the current date and time.
Any ideas??
Thanks to all and have a great day.
Rich
I have a form that adds an item to a shopping cart. The user would like her items available only during certain parts of the day as she delivers the items same day, and only certain items are available on certain days.
So her shopping page looks something like this (each item is it's own form, and the buy now button submits the form):
Monday: Item 1 <buy now button>
Tuesday: Item 2 <buy now button>
Wednesday: Item 3 <buy now button>
and so on
Let's say the cutoff time is 10am
On Sunday, you will see all items with the buy now buttons. On Monday, if it's before 10am, you will see everything.
On Monday at 10:01am you will see
Monday: Item 1 "Sorry this is no longer available to order today"
Tuesday: Item 2 <buy now button>
Wednesday: Item 3 <buy now button>
So I need to either display the buy now button (which submits the form), or show a message. Which one is shown is based on the current date and time.
Any ideas??
Thanks to all and have a great day.
Rich