In Jquery script, as you can see below. The elements for the detail are created dynamically inside a jquery's function. However when assigning the value from variable "startLocation" to the input "detail_startLocation[]", the value is not full assigned. It seems only the first word.
For example the value of "startLocation" is "Grand Hyatt" but only "Grand" is shown as the value of "detail_StartLocation[]". When alerting the variable, it returns the full value. Does any one know what's wrong ?
var startLocation = jQuery("#txtStartLocation").val();
var endLocation = jQuery("#txtEndLocation").val();
var date2 = jQuery.datepicker.formatDate("DD, MM d, yy", new Date(jQuery("#txtStartDate").val()));
for(i=1; i<= n_day;i++){
var detail = '<div> </div>'
+'<div><h4>Day-'+i+' : '+date2+'</h4></div>'
+'<div class="table">'
+'<div class="tr">'
+'<div class="td"> </div>'
+'<div class="td">Start</div>'
+'<div class="td">End</div>'
+'</div>'
+'<div class="tr">'
+'<div class="td">Travel time</div>'
+'<div class="td"><input type="text" name="detail_startTime[]" value= '+startTime+' /></div>'
+'<div class="td"><input type="text" name="detail_endTime[]" value= '+endTime+' /></div>'
+'</div>'
+'<div class="tr">'
+'<div class="td">Location</div>'
+'<div class="td"><input type="text" size="100" name="detail_startLocation[]" value= '+startLocation+' /></div>'
+'<div class="td"><input type="text" name="detail_endLocation[]" value= '+endLocation+' /></div>'
+'</div>'
+'</div>';
jQuery("#detail").append(detail);
date2 = new Date(jQuery("#txtStartDate").val());
date2.setDate(startDate.getDate() + i);
date2 = jQuery.datepicker.formatDate("DD, MM d, yy", new Date(date2));
}