下拉计算日期 [英] Dropdown calculates date
问题描述
有人可以指导我朝正确的方向发展吗?我的下拉值为1到14(1 = 1天,2 = 2天,3 = 3天等)。下拉的交换应该计算从今天开始的天数。如果今天是4/1/08并且用户选择3,则输出应显示为4/4/08。但是,我的问题是日期没有变化。
[HTML]< select name =" lstPrpTypeDesc" ID = QUOT; lstPrpTypeDesc" onblur =" validate(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 = $ _ SESSION [''values''] [''lstPost''];
$ exp_date = time()+(86400 * $ postdays);
$ expdate = date('l,mdY H:i:s A'',$ exp_date);
echo $ expdate;?> [/ PHP]
< blockquote> PostOptions = array(" 0" =>" [Select]",
" 1" =>" 3",
" ; 2" =>" 4",
" 3">" 5",
" 4" =>" 6" ,
" 5" =>" 7",
" 6">" 14");
current = time();
postdays =
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="lstPrpTypeDesc" id="lstPrpTypeDesc" onblur="validate(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=$_SESSION[''values''][''lstPost''];
$exp_date = time() + (86400 * $postdays);
$expdate = date(''l, m-d-Y H:i:s A'', $exp_date);
echo $expdate;?>[/PHP]
PostOptions = array("0" => "[Select]",
"1" => "3",
"2" => "4",
"3" => "5",
"4" => "6",
"5" => "7",
"6" => "14");
current = time();
postdays=
这篇关于下拉计算日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!