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);


Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.