locked
How can I get Html 5 calendar selected value in another textbox using javascript please suggest RRS feed

  • Question

  • How can I get Html 5 calendar selected value in another textbox using javascript  please suggest

    Thanks

    Murali

    Saturday, April 6, 2013 10:32 AM

Answers

  • See Here: 
    WinJS.UI.DatePicker

    There you can see you can attach a onchange listener to it, to see when it has changed, and you can also read the current value with .current i.e:

    var cal = document.querySelector("calendar");
    var calControl = cal.winControl;
    
    var textbox = document.querySelector("textbox");
    
    calControl.onchange = function () {
       //format this how ever you want
       textbox.value = calControl.current.toString() 
    }

    Sunday, April 7, 2013 6:42 PM