1. I've started a massive SPAM purge, any accounts that have spammed are being removed, also for a short period new user signups are disallowed until the SPAM cleaning is finished.

Is this possible - todays date

Discussion in 'Java Script/AJAX' started by Indianseo, Jul 19, 2010.

  1. Indianseo

    Indianseo Banned

    Joined:
    Jul 15, 2010
    Messages:
    30
    Likes Received:
    0
    Trophy Points:
    0
    Hi Friends

    i have added a form on my site that has a date picker... Is it possible for the form to select todays date when the page opens...



    Thanks In advance:):D
    Loading...
  2. PradeepKr

    PradeepKr New Member

    Joined:
    Aug 16, 2010
    Messages:
    21
    Likes Received:
    1
    Trophy Points:
    0
    of-course possible. Do it in
    HTML:
    <body onload="todaysdate();">
    HTML:
    <SCRIPT LANGUAGE="Javascript">
    <!--   function todaysdate() {
    // Array of day names
    var dayNames = new Array("Sunday","Monday","Tuesday","Wednesday",                 "Thursday","Friday","Saturday");  // Array of month Names var monthNames = new Array( "January","February","March","April","May","June","July", "August","September","October","November","December");  
    var now = new Date();
    document.write(dayNames[now.getDay()] + ", " +  monthNames[now.getMonth()] + " " +  now.getDate() + ", " + now.getFullYear());  
    }
    // -->
    </SCRIPT>
    digitalpoin8 likes this.
  3. jennifersmith

    jennifersmith New Member

    Joined:
    Nov 16, 2010
    Messages:
    63
    Likes Received:
    1
    Trophy Points:
    0
    yes so simple use getdate() function in php code
    ffunction call to display result.
  4. markhill

    markhill Member

    Joined:
    Mar 31, 2010
    Messages:
    43
    Likes Received:
    0
    Trophy Points:
    6
    You can pick the desired date from HTML section.That is very well explained by PradeepKr.
  5. DrewryMedia

    DrewryMedia Banned

    Joined:
    Sep 5, 2010
    Messages:
    127
    Likes Received:
    0
    Trophy Points:
    0
    I need to learn how to write javascript
  6. zslgreen

    zslgreen New Member

    Joined:
    Apr 20, 2011
    Messages:
    97
    Likes Received:
    2
    Trophy Points:
    0
    <h4>It is now
    <script type="text/javascript">
    <!--
    var currentTime = new Date()
    var month = currentTime.getMonth() + 1
    var day = currentTime.getDate()
    var year = currentTime.getFullYear()
    document.write(month + "/" + day + "/" + year)
    //-->
    </script>
    </h4>
  7. digitalpoin8

    digitalpoin8 New Member

    Joined:
    Jan 15, 2014
    Messages:
    5
    Likes Received:
    1
    Trophy Points:
    1
    Gender:
    Male
    Location:
    UAE
    Thank you
  8. Maureen P. James

    Maureen P. James Member

    Joined:
    Jul 8, 2014
    Messages:
    40
    Likes Received:
    0
    Trophy Points:
    6
    Gender:
    Male
    Location:
    UK, london
    Yes, it is so simple. Use getdate() function. Or you can also use html coding in body section.

Share This Page