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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CLOCK AND CALENDER

Status
Not open for further replies.

gsc123

Programmer
Jan 24, 2008
197
i want to add the date and time to a database from a form so it needs to be a selectable time and date so there are no errors submitting, is there anything out their to use to pick date and time?
 
Hand can this be used to add to database in this format?
 
Hi

If your question meas "can such JavaScript date & time picker format the date & time value in the format accepted by my database", then yes, almost certainly can.

However your approach is wrong. All data received from the client side must be validated on the server side. And while you validate them, you can easily format them. Client side should not be involved in this.

Feherke.
 
On submitting the form the time and date could be validated then could it not? I onyl want a front end client side so no typos are made
 
In your case, performing client-side validation would be OK because you know the user has JS enabled, otherwise they would not be able to use your JS-only controls.

However, should you provide a fall-back mechanism (e.g. text-only input field) for those with JS disabled, then you would still need to perform server-side validation on this.

Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

Dan's Page [blue]@[/blue] Code Couch:
Code Couch Tech Snippets & Info:
 
Even with client side validation in javascript you should still validate ALL date server side to protect against malicious/faked submissions.

client side validation should only be seen as an aid to the for easy of use.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top