Forum Moderators: coopster

Message Too Old, No Replies

selet date from calendar, insert into database as date format

         

brodie_r

3:08 pm on Feb 18, 2006 (gmt 0)

10+ Year Member



To give you the background, this is a page for booking jobs. It ranges from client name, to location, to machine , then i need the date when the job is to be carried out. So i want to be able to have a little calendar, and be able to go through select the date and it will then input that into the database when i submit the book job form. So pretty much everyday is linkable to a value that is in the format of DATETIME. Possible?

coopster

8:17 pm on Feb 21, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



So you have a form with an input element that will accept a date that the user can either type in or select from a little pop-up calendar? Have you searched for "JavaScript Calendars"? There are a ton of examples out there. Most of them will have an option to set the date format that you would like returned as well.

Don't forget to validate that date once it gets back to you on the server though!

brodie_r

11:22 am on Feb 22, 2006 (gmt 0)

10+ Year Member



Yes found a great javascript calander, that inputs the date into a text box then i just insert that into the database (DATE) field.

<input type="text" name="date" size="12" maxlength="25" value="" />
<A HREF="#" onClick="cal.select(document.forms['add_job'].date,'anchor1','yyyy-MM-dd'); return false;"
NAME="anchor1" ID="anchor1"><img src="cal_icon.gif" width="24" height="14" border="0" /></A>