Grow your CSS skills. Land your dream job.

Todays date as default value for input field

  • # February 23, 2013 at 12:33 am

    Hello all,
    I have an input field for the user to enter a date in, but most of the time they will want todays date, so I’m looking for some code, could be JS, PHP or jQuery. to put into my value=”” in the input box to save them the work.

    I’ve tried and the code shows not the date.
    I tried < ?php $thedate = date("y-m-d"); ?> because I read that javascript would be easy toy for hackers in this situation.

    I need the date in this format 20130215 ymd

    Your ideas are appreciated.

    # February 23, 2013 at 5:35 am

    `$thedate = date(“Ymd”);`

    Where have you read that JavaScript here would be vulnerable to hacking? It’s not true :)

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".