日期:2014-05-16  浏览次数:20403 次

请教javascript联动问题
搜索条件有两个
如果是题目,内容,作者(select),select框的右边是一个   text
如果是日期,select框   右边是   text+img   ~   text+img(img触发   选择日期的新窗口)


<select   name= "SEARCH_CODE "   onChange= "javascript:searchType(); ">
<option   value= "1 "> 题目 </option>
<option   value= "2 "> 作者 </option>
<option   value= "3 "> 内容 </option>
<option   value= "4 "> 分类 </option>
<option   value= "5 "> 日期 </option>
</select>
 
1~4   显示这个  
<input   name= "SEARCH_CONTENT "   type= "text "   size= "50 "   value= " ">
5   显示下面
<input   name= "START_DATE "   type= "text "   value= " <%=dftEvalDate   %> "〉
<a   href= "javascript:setStartDate(); ">
    <img   src= "/epm/images2/button/btnpop_calendar.gif "   width= "27 "height= "20 "   border= "0 "   align= "absmiddle ">
</a>
<input   name= "END_DATE "   type= "text "   value= " <%=dftEvalDate   %> "   >                       <a   href= "javascript:setEndDate(); ">
      <img   src= "/epm/images2/button/btnpop_calendar.gif "   width= "27 "   height= "20 "   border= "0 "   align= "absmiddle ">
</a>

select和text要在同一行


------解决方案--------------------
写了一段,L@_@K!

<html xmlns= "http://www.w3.org/1999/xhtml ">
<head>
<title> new document </title>
<meta name= "generator " content= "editplus " />
<script type= "text/javascript ">
<!--
function searchType(strValue)
{
switch (parseInt(strValue))
{
case 1:
case 2:
case 3:
case 4:
document.all.s1.style.display = "inline ";
document.all.s2.style.display = "none ";

break;
case 5:
document.all.s1.style.display = "none ";
document.all.s2.style.display = "inline ";
break;
}
}
//-->
</script>
</head>

<body>
<select name= "SEARCH_CODE " SIZE= "1 " onchange= "javascript:searchType(this.value); ">
<option value= "0 " selected> 请选择 </option>
<option value= "1 "> 题目 </option>
<option value= "2 "> 作者 </option>
<option value= "3 "> 内容 </option>
<option value= "4 "> 分类 </option>
<option value= "5 "> 日期 </option>
</select>
<span id= "s1 " style= "display: none "> <input name= "SEARCH_CONTENT " type= "text " size= "50 " value= " "> </span>
<span id= "s2 " style= "display: none ">
<input name= "START_DATE " type= &