Can someone guide me in the right direction? I have a drop down with values of 1 through 14 (1 = 1 day, 2 = 2 days, 3 = 3 days, ect). The onchange the drop down should calculate the days starting from today. If today is 4/1/08 and the user selects 3 then the output should show 4/4/08. However, my problem is that the date is not changing.
[HTML]<select name="lstPrpTyp eDesc" id="lstPrpTypeD esc" onblur="validat e(this.value, this.id)" onchange="????" >[/HTML]
[PHP]<?php
$PostOptions = array("0" => "[Select]",
"1" => "3",
"2" => "4",
"3" => "5",
"4" => "6",
"5" => "7",
"6" => "14");
$current = time();
$postdays=$_SES SION['values']['lstPost'];
$exp_date = time() + (86400 * $postdays);
$expdate = date('l, m-d-Y H:i:s A', $exp_date);
echo $expdate;?>[/PHP]
[HTML]<select name="lstPrpTyp eDesc" id="lstPrpTypeD esc" onblur="validat e(this.value, this.id)" onchange="????" >[/HTML]
[PHP]<?php
$PostOptions = array("0" => "[Select]",
"1" => "3",
"2" => "4",
"3" => "5",
"4" => "6",
"5" => "7",
"6" => "14");
$current = time();
$postdays=$_SES SION['values']['lstPost'];
$exp_date = time() + (86400 * $postdays);
$expdate = date('l, m-d-Y H:i:s A', $exp_date);
echo $expdate;?>[/PHP]
Code:
function ajaxtime(val) {var req;try{req = new XMLHttpRequest();} catch (e){try{req = new ActiveXObject("Msxml2.XMLHTTP");} catch (e) {try{req = new ActiveXObject("Microsoft.XMLHTTP");} catch (e){alert("Please Update Your Browser");return false;}}}req.onreadystatechange = function(){if(req.readyState == 4){document.getElementById('response').innerHTML = req.responseText;}}req.open("GET", "time.php", true);req.send(null);}
Comment