Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Date in Textbox

Does anyone know how to populate a Textbox with the current date?

I have a Input textbox that i will make locked that i just want to have it populated with the current date everytime my form is opened.

Comments

  • vanithvanith Member Posts: 44
    : Does anyone know how to populate a Textbox with the current date?
    :
    : I have a Input textbox that i will make locked that i just want to have it populated with the current date everytime my form is opened.
    :
    :
    Hi!

    Which date you want to populate? Server or Client?


    1. To populate Server's date, it's very simple.
    [code]
    ">
    [/code]


    2. To populate user's local system date
    [code]

    function populateDate()
    {
    var d =new Date();
    txtCurDate.value = d.getMonth() +"/"+d.getDay()+ "/"+d.getFullYear();
    }

    .
    .
    .

    .
    .

    ..
    [/code]

    :)heers,
    Vanith

  • penny_xpenny_x Member Posts: 2
    running time:


    var timerID = null;
    var timerRunning = false;
    function stopclock (){
    if(timerRunning)
    clearTimeout(timerID);
    timerRunning = false;}
    function startclock () {
    stopclock();
    showtime();}
    function showtime () {
    var now = new Date();
    var hours = now.getHours();
    var minutes = now.getMinutes();
    var seconds = now.getSeconds()
    var timeValue = "" +((hours >= 12) ? "AM " : "PM " )
    timeValue += ((hours >12) ? hours -12 :hours)
    timeValue += ((minutes < 10) ? ":0" : ":") + minutes
    timeValue += ((seconds < 10) ? ":0" : ":") + seconds
    document.clock.thetime.value = timeValue;
    timerID = setTimeout("showtime()",1000);
    timerRunning = true;}






  • Shawn CarterShawn Carter Member Posts: 0

    _________ { http://forcoder.org } free ebooks and video tutorials about \ Visual Basic, Java, Python, Ruby, C++, PHP, JavaScript, Swift, Go, R, Objective-C, PL/SQL, Scratch, C#, C, Delphi, Assembly, Visual Basic .NET, MATLAB, Perl Rust, Crystal, D, Scala, Bash, Scheme, Lua, Julia, Lisp, Awk, Fortran, SAS, VBScript, Dart, Kotlin, LabVIEW, COBOL, ABAP, Prolog, Logo, Ada, Hack, FoxPro, Alice, Clojure, Erlang, ML, Transact-SQL, F#, Apex \ _________

Sign In or Register to comment.