关于select下拉选择框的问题

xuhui8282 2008-12-01 03:39:27
<select name="sinbn">
<option value="0" >--请选择新闻类别--</option>
<option value="1" >图片新闻</option>
<option value="2" >公告</option>
<option value="3" >皎口动态</option>
<option value="4" >水利新闻</option>
</select></td>
</tr>
<script type="text/javascript" language="javascript">
if(ducument.sinbn.value="1")
{document.write("<tr>
<td class="tdQuery">图片:</td>
<td class="td2"><input name="pic" type="file"size="70" maxlength="100"></td>
</tr>
<tr>
<td class="tdQuery1">内容:</td>
<td class="td5">
<%
Dim oFCKeditor
Set oFCKeditor = New FCKeditor
oFCKeditor.BasePath = "FCKeditor/"

oFCKeditor.ToolbarSet = "Default"
oFCKeditor.Width = "100%"
oFCKeditor.Height = "350px"

oFCKeditor.Value = ""
oFCKeditor.Create "txtcontent"
%>
</td></tr>")}
else{document.write("
<tr>
<td class="tdQuery1">内容:</td>
<td class="td5">
<%

oFCKeditor.BasePath = "FCKeditor/"

oFCKeditor.ToolbarSet = "Default"
oFCKeditor.Width = "100%"
oFCKeditor.Height = "350px"

oFCKeditor.Value = ""
oFCKeditor.Create "txtcontent"
%>
</td></tr>")}
</script>

如何让一选择select中的某一个值网页就立即显示该选项的结果,请详细说明
...全文
151 18 打赏 收藏 转发到动态 举报
写回复
用AI写文章
18 条回复
切换为时间正序
请发表友善的回复…
发表回复
xuhui8282 2008-12-02
  • 打赏
  • 举报
回复
我就是不知道该怎么搞啊
如你所说,我是那样做了
virgo2008 2008-12-02
  • 打赏
  • 举报
回复
<tr>
<td class="tdQuery">图片: </td>
<td class="td2"> <input name="pic" type="file"size="70" maxlength="100"> </td>
</tr>
<tr>
<td class="tdQuery1">内容: </td>
<td class="td5">
<%
Dim oFCKeditor
Set oFCKeditor = New FCKeditor
oFCKeditor.BasePath = "FCKeditor/"

oFCKeditor.ToolbarSet = "Default"
oFCKeditor.Width = "100%"
oFCKeditor.Height = "350px"

oFCKeditor.Value = ""
oFCKeditor.Create "txtcontent"
%>
</td> </tr>

你想把上面的内容输入到<span></span>里面去???
xuhui8282 2008-12-02
  • 打赏
  • 举报
回复
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>
<script language="javascript">
function aa(x)
{
if(x==1)
document.getElementById('aa').innerHTML='新'
if(x==2)
document.getElementById('aa').innerHTML='闻'
if(x==3)
document.getElementById('aa').innerHTML='联'
if(x==4)
document.getElementById('aa').innerHTML='播'
}
</script>
<body>
<form id="form1" name="form1" method="post" action="">
<select name="select" id="select" onchange="aa(this.value)">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
</select>
<span id="aa"></span>
</form>
</body>
</html>
我用
<tr>
<td class="tdQuery">图片: </td>
<td class="td2"> <input name="pic" type="file"size="70" maxlength="100"> </td>
</tr>
<tr>
<td class="tdQuery1">内容: </td>
<td class="td5">
<%
Dim oFCKeditor
Set oFCKeditor = New FCKeditor
oFCKeditor.BasePath = "FCKeditor/"

oFCKeditor.ToolbarSet = "Default"
oFCKeditor.Width = "100%"
oFCKeditor.Height = "350px"

oFCKeditor.Value = ""
oFCKeditor.Create "txtcontent"
%>
</td> </tr>
替换了document.getElementById('aa').innerHTML='新'中的'新'
所以就不行了
virgo2008 2008-12-02
  • 打赏
  • 举报
回复
你的js在哪 没有看到啊
xuhui8282 2008-12-02
  • 打赏
  • 举报
回复
判断下拉选择框的值来判断输出
xuhui8282 2008-12-02
  • 打赏
  • 举报
回复
我的文件是.asp,内部掺和了js,我想根据判断输出
<tr>
<td class="tdQuery">图片: </td>
<td class="td2"> <input name="pic" type="file"size="70" maxlength="100"> </td>
</tr>
<tr>
<td class="tdQuery1">内容: </td>
<td class="td5">
<%
Dim oFCKeditor
Set oFCKeditor = New FCKeditor
oFCKeditor.BasePath = "FCKeditor/"

oFCKeditor.ToolbarSet = "Default"
oFCKeditor.Width = "100%"
oFCKeditor.Height = "350px"

oFCKeditor.Value = ""
oFCKeditor.Create "txtcontent"
%>
</td> </tr>
但就是不行
virgo2008 2008-12-02
  • 打赏
  • 举报
回复
js里面是可以掺和asp一起用的,但是你不用能.js的文件保存!
xuhui8282 2008-12-02
  • 打赏
  • 举报
回复
简单点问吧,document.write("这里面能不能加上<%%>")
alandy 2008-12-01
  • 打赏
  • 举报
回复
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>
<script language="javascript">
function aa(x)
{
var obj=document.getElementById('x')
var val=obj.options[obj.selectedIndex].value
if(val==1){
/*写上你的代码*/
}else{
/*写上你的代码*/
}
}
</script>
<body>
<form id="form1" name="form1" method="post" action="">
<select name="select" id="select" onchange="aa(this.id)">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
</select>
</form>
</body>
</html>
virgo2008 2008-12-01
  • 打赏
  • 举报
回复
在试试看!

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>
<script language="javascript">
function aa(x)
{
if(x==1)
document.getElementById('aa').innerHTML='新'
if(x==2)
document.getElementById('aa').innerHTML='闻'
if(x==3)
document.getElementById('aa').innerHTML='联'
if(x==4)
document.getElementById('aa').innerHTML='播'
}
</script>
<body>
<form id="form1" name="form1" method="post" action="">
<select name="select" id="select" onchange="aa(this.value)">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
</select>
<span id="aa"></span>
</form>
</body>
</html>
xuhui8282 2008-12-01
  • 打赏
  • 举报
回复
这个可以是可以,但是加了if ...else以后就不行啦
virgo2008 2008-12-01
  • 打赏
  • 举报
回复
你试试上面的那个,就是判断x的值!
virgo2008 2008-12-01
  • 打赏
  • 举报
回复

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>
<script language="javascript">
function aa(x)
{
document.getElementById('aa').innerHTML=x
}
</script>
<body>
<form id="form1" name="form1" method="post" action="">
<select name="select" id="select" onchange="aa(this.value)">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
</select>
<span id="aa"></span>
</form>
</body>
</html>

xuhui8282 2008-12-01
  • 打赏
  • 举报
回复
不起作用
xuhui8282 2008-12-01
  • 打赏
  • 举报
回复
select里面还是写一样的吗
virgo2008 2008-12-01
  • 打赏
  • 举报
回复
onchange="aa(this.value)"

function aa(x)
{
var str=x
if(str=="1")
//
else
//
}
xuhui8282 2008-12-01
  • 打赏
  • 举报
回复
我可能没说清楚,是这样的,当我选择"图片新闻"时,网页马上显示if后面的句子,当我选择其他选项时,网页马上显示else后面的句子,不需要再按什么按钮
virgo2008 2008-12-01
  • 打赏
  • 举报
回复
onchange="javascript:document.getElementByID('***').value=this.value"

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧