/    Sign up×
Community /Pin to ProfileBookmark

Best way for future date input

I am making a band a website and also a rudimentary cms. There is going to be an “add a gig” section so that they can enter location, date and description of a gig, info then stored in mysql. I’m wondering the best way to allow them to enter the date. The reason I ask is that they have a gigs page and I’d like it so that any gigs in the future are in the “upcoming gigs” section and any in the past are in the “previous gigs” section. I know I could put a note saying exactly what format it has to go in but I’d like to eliminate the possibility of user error.

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@NogDogMar 17.2006 — Surest way is to provide 3 select elements: one for month, one for day, and one for year. Then the script needs to combine them together into a suitable format for entry into the database, doing a bit of validation to make sure you don't have a Feb. 30 or Sep. 31. (see the checkdate() function).
Copy linkTweet thisAlerts:
@DoppleauthorMar 17.2006 — Thanks NogDog. Of course that's the best way to do it, thinking about the way forum registration type forms do it.

Cheers
×

Success!

Help @Dopple spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...