SOS !!!怎样得到网页里下拉框里的内容,然后将其显示出来。。。祥情请看内容

coollele 2000-06-07 10:34:00
怎样得到下拉框里的内容呢? 比如有一个下拉框,里面有深圳市,上海市,北京市,当用户选则了,中间一个,“上海市”那么我的ASP就要得到用户的选则,然后给出一个确定框,告诉用户已选则了上海市。问题是我不知怎样写ASP来得到用户的选则,望大虾给我指教,给点祥细的代码。。。。。。初学者笨人。
...全文
216 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
coollele 2000-06-07
  • 打赏
  • 举报
回复
你们太伟大了,真的非常感谢!!!!
zy 2000-06-07
  • 打赏
  • 举报
回复
<select onchange="alert(this.options[this.options.selectedIndex].text)">
<option value=深圳市>深圳市
<option value=上海市>上海市
</select>
mxp 2000-06-07
  • 打赏
  • 举报
回复
提交后request("列表名")肯定能得到用户选择的.value的值。
coollele 2000-06-07
  • 打赏
  • 举报
回复
我想再次说明一下。。
首先,我想有个HTML的页面,让用户选则,下拉框里的内容,当提交后,ASP怎样得到HTML里用户的选则,我问的是ASP怎样写,不是和MXP那样说的然后ASP再自动生成一个HTML的页面,给出一个确定页面,告诉用户,说明刚刚的选则。
mxp 2000-06-07
  • 打赏
  • 举报
回复
用户选择需要调入下一个页面<form action="***.asp" ......>
才能用.value来查!
提示可用javascript,也可调前用按钮事件写_onclik!

mxp 2000-06-07
  • 打赏
  • 举报
回复
哈哈这个问题我回答过,详情请看:
http://210.77.145.209/csdn/expert/Topic/10398.shtm
再拷一次:

用javascript实现!
如:
<html>

<script Language="JavaScript"><!--
function info_option(theForm)
{

if (theForm.infotitle.value == "")
{
alert("标题不能为空!");
theForm.infotitle.focus();
return (false);
}

if (theForm.file_wz.value == "" && theForm.file_wj.value == "")
{
alert("内容和文件不能全为空!");
theForm.file_wz.focus();
return (false);
}
if (theForm.file_wz.value != "" && theForm.file_wj.value != "")
{
alert("内容和文件只能填写一项!");
theForm.file_wz.focus();
return (false);
}

return(true);
}

function chlist(list)
{
var listtext='';
if(list.selectedIndex!=-1)
{
listtext=list.options[list.selectedIndex].value;
}
switch(listtext)
{
case '1':
document.all['mxp1'].style.display="";
document.all['mxp2'].style.display="none";
document.all['mxp3'].style.display="none";
document.all['mxp4'].style.display="none";
break;
case '2':
document.all['mxp1'].style.display="none";
document.all['mxp2'].style.display="";
document.all['mxp3'].style.display="none";
document.all['mxp4'].style.display="none";
break;
case '3':
document.all['mxp1'].style.display="none";
document.all['mxp2'].style.display="none";
document.all['mxp3'].style.display="";
document.all['mxp4'].style.display="none";
break;
}

}
//-->
</script>

<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>信息录入表</title>
</head>

<body>

<p align="center"><b><font color="#800000" size="5">信息录入表</font></b></p>
<hr>
<form method="POST" action=info_write.ASP?WCI=info&WCE=add onSubmit="return info_option(this)" name="fileinput" ENCTYPE="multipart/form-data">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>
<td width="656">类型:<select size="1" name="file_type">
<option Value=1 selected>周工作安排 </option>
<option Value=2 >周工作通知</option>
<option Value=3 >周工作信息 </option>
</select>  </td>


</tr>
</table>
<table border="0" cellspacing="0" cellpadding="0" style="display:" >
<tr>
<td width="100%"> 级别:<select size="1" name="fiel_level" onchange="chlist(this);">
<option Value=1 selected>处室级 </option>
<option Value=2>年部级</option>
<option Value=3>学科级 </option>
</select></td>
</tr>
</table>
<table border="0" cellspacing="0" cellpadding="0" style="display:" ID=mxp1>
<tr>
<td width="100%"> 处室:<select size="1" name="cs">
<option Value=1 selected>校长办</option>
<option Value=2 >书记办 </option>
<option Value=3 >教务处</option>
<option Value=4 >德育处 </option>
</select></td>
</tr>
</table>
<table border="0" cellspacing="0" cellpadding="0" style="display:none" ID=mxp2>
<tr>
<td width="100%"> 年部:<select size="1" name="grade">
<option Value=1 >9801 </option>
</select></td>
</tr>
</table>
<table border="0" cellspacing="0" cellpadding="0" style="display:none" ID=mxp3>
<tr>
<td width="100%"> 学科:<select size="1" name="dept">
<option Value=001 selected>数学</option>
<option Value=002>语文</option>
</select></td>
</tr>
</table>
<hr>
<p align="left">标题:<input type="text" name="infotitle" size="76"></p>
<p align="left">内容:</p>
<p align="left"><textarea rows="5" name="file_wz" cols="81"></textarea></p>
<p align="left">上传文件:<input type="file" name="file_wj" size="62"></p>
<p align="center"><input type="submit" value="提交" name="tj">   
  <input type="reset" value="重写" name="cx"></p>
</form>

</body>

</html>

28,390

社区成员

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

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