提交表单时如何调用多个下拉菜单数据到一个文本框中
代码如下:
<form name= "form1 " method= "post " action= " ">
<input name= "day " type= "text " id= "day " value= "2007-01-01 ">
<select name= "nian " id= "nian ">
<option value= "2007 "> 2007年 </option>
<option value= "2006 "> 2006年 </option>
<option value= "2005 "> 2005年 </option>
<option value= "2004 "> 2004年 </option>
<option value= "2003 "> 2003年 </option>
<option value= "8 "> 8 </option>
</select>
<select name= "yue " id= "yue ">
<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>
<option value= "8 "> 8月 </option>
<option value= "9 "> 9月 </option>
<option value= "10 "> 10月 </option>
<option value= "11 "> 11月 </option>
<option value= "12 "> 12月 </option>
</select>
<select name= "xun " id= "xun " >
<option value= "9 "> 上旬 </option>
<option value= "19 "> 中旬 </option>
<option value= "28 "> 下旬 </option>
</select>
<input type= "submit " name= "Submit " value= "提交 ">
</form>
如何做才能在点击提交按钮时,将年、月,旬整合到一个文本框中,格式为YYYY-MM-DD
请高手帮忙呀!!
------解决方案-------------------- <script language= "javascript ">
function check1(a,b,c)
{
var a,b,c;
if (parseInt(b) <10)
{
b= "0 "+b;
}
if (parseInt(c) <10)
{
c= "0 "+c;
}
this.form1.day.value=a+ "- "+b+ "- "+c;
}
</script>
<form name= "form1 " method= "post " action= " ">
<input name= "day " type= "text " id= "day " value= "2007-01-01 ">
<select name= "nian " id= "nian " onchange= "check1(