///input 2
<td size = '2' align ='right'><b>No of night(s):</b>
<td align="left"><select name="night" id="night" onchange="showChkoutDate(this.night.value)">
<option value = "1">1</option>
<option value = "2">2</option>
<option value = "3">3</option>
<option value = "4">4</option>
<option value = "5">5</option>
<option value = "6">6</option>
<option value = "7">7</option>
// function javascript ที่เรียก
function showChkoutDate(num){
var myDate = new Date();
var date = document.getElementById('checkindate');
var brokenstring=date.split(”-“);
myDate.setYear(parseInt(brokenstring[2].value));
myDate.setMonth(parseInt(brokenstring[1].value-1));
myDate.setDate(parseInt(brokenstring[0].value)+parseInt(num));
var chkout = myDate.format('dd mmmm yyyy');
document.getElementById('checkout').innerHTML = chkout;
}
/// แสดง out put
<td><input type ="hidden" style = "border:none; text-align:center;" name="checkout" id ="checkout" size="10" readonly="readonly">