什么即时试图做的是当<option>
点击的值将显示在<input type='text'>
如何在html选项中添加onClick?
这里是我的代码现在:
<select id='months'>
<option value='9' id='months9'>9 Months</option>
<option value='10' id='months10'>10 Months</option>
<option value='11' id='months11'>11 Months</option>
<option value='12'id='months'>12 Months</option>
</select>
if($months == '9'){
echo 'today +9 months';
}
if($months == '10'){
echo 'today + months';
}
if($months == '11'){
echo 'today +11 months';
}
if($months == '12'){
echo 'today +12 months';
}
<input type='text' name='signoff_date'>
注:我知道这个代码将无法正常工作我”只是让你知道我的程序是如何工作的。
我希望你能理解它。由于
到目前为止,我只尝试的PHP代码的后,才改变输入文本的价值你提交表格 –
可能重复[Javascript - onchange
请检查此链接:-http://stackoverflow.com/questions/3487263/how-to-use-onclick-or-onselect-on-option-tag-in-a-jsp-page –