Start New Discussion within our Web Development Community

Here is my code:

$(document).ready(function () {
    $(".submit-text").click(function () {

         var startdate = $("#startdate").val(); /*This line returns mm/dd/yyyy */
         var starttime = $("#starttime").val(); /*This line retruns hr:min AM/PM */

         var dtstart =  new Date("startdate" + starttime);

****On alert it displays invalid date...         

but if I use..  

var dtstart =  new Date("02/14/2013 " + starttime);

It alerts proper result...I am not getting what is wrong with this...need help

Thanx in advance

I got it...
In new Date() we can only pass string and not variable..
d =startdate + " " + starttime;
var dtstart = new Date(d);


This question has already been answered. Start a new discussion instead.