Results 1 to 2 of 2

Thread: Validation with Javascript

  1. #1
    Join Date
    May 2007
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Validation with Javascript

    Hi I have a small problem, I am not a strong coder and need some advice on how to do time and date validation through javascript

    my main coding language is php though doing validation through javascript

    what I need to do is the following:

    - the starttime needs to be inputted as hh:mm (no seconds are needed) and the format will be army time so a 24 hour clock
    - the starttime can only be in 30 minute lots, so a user can enter any hour up to 24 but the minutes can only be 00 or 30 nothing in between or after.
    - the endtime needs to have a loop that will call the starttime and add 30 minutes or 1 hour depending on what radio button you choose, for example if a user enters 11:00 then the end time will be either 12:00 or 11:30.

    If anyone can help me I will be extremely grateful I am so lost on how to do this and I cannot seem to find relevant information on the internet that will work for the 30 minute/hour increments

    My current code is attached as 'addprogram' it should be a php file, and the database.txt contains the database structure, I am using wamp5 which has mysql as the database creator
    --------------------------------------


    I am sorry if i have created this topic in the wrong section, I am also new to this forum so still trying to get used to things.
    Last edited by Jewelette; 05-16-2007 at 06:12 AM. Reason: adding database

  2. #2
    Join Date
    Jul 2006
    Location
    just north of Boston, MA
    Posts
    1,806
    Thanks
    13
    Thanked 72 Times in 72 Posts

    Default

    Why are you doing the validation in javascript? It is client-side based, and there are numerous people that have javascript disabled, either by default/annoyance/malicious. I highly suggest that you re-sanitize / re-validate using your php script.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •