如何读二个下拉列表框的值? document.f1.fsexy.value改为document.f1.fsexy.options[document.f1.fsexy.selectedIndex].value 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 为什么要加document.f1.fsexy.selectedIndex直接的value不是这个控件选中那条的value吗? 哦 看错了function showimage() { document.f1.fimg.src=eval("face/"+document.f1.fsexy.value+document.f1.fimage.value+".gif"); } 改为这样了还是不行document.f1.fimg.src="face/"+document.f1.fsexy.options[document.f1.fsexy.selectedindex].value+document.f1.fimage.options[document.f1.fimage.selectedindex].value+".gif"; 这样也还是不行:document.f1.fimg.src=eval("face/"+document.f1.fsexy.value+document.f1.fimage.value+".gif"); 晕了 你把你的html页面代码发给我 我调试下 概念错误。在客户端动态加载图片,必须用 http://xxxxxxxxxxxx……因为此时代码已经下载到客户的硬盘上了。@_@ 代码如下:<!--#include file="conn.asp"--><script language="javascript">function check(){if(document.f1.fname.value=""||document.f1.femail.value=""||document.f1.fweb.value=""||document.f1.fnr.value="") { alert("请认真填写"); return false; }else { document.f1.submit(); }}function showimage(){document.f1.fimg.src=eval("face/"+document.f1.fsexy.value+document.f1.fimage.value+".gif");document.write(document.f1.fimg.src);}</script><%iuser=request.querystring("user")if request.querystring("user")="" or request.querystring="" then response.redirect("reg.asp")esle msql="select * from [user] where [user]='"&iuser&"'" set rs=conn.execute(msql) if rs.eof and rs.bof then rs.close set rs=nothing conn.close set conn=nothing response.write("<script>alert('没有此版,请申请');location.href='reg.asp';</script>") response.end else if session("user")=rs("user") and session("pwd")=rs("pwd") then power="ok" else power="" end if end if end if%><table border=0 width="680" align="center"><tr><td><form action="index.asp?user='<%=iuser%>' method="post" name="f1"> <table border=0 width="100%"> <tr><td colspan=2>姓名:<input type="text" name="fname" size=20 maxlength=16>  留言性质:<input type="radio" name="fr" value="r1" checked>公开<input type="radio" name="fr" value="r2">悄悄话   性别:<select name="fsexy" size=1 onchange="showimage();"> <option value="m" selected >男</option> <option value="w">女</option> </select>   表情: <select name="fimage" onchange="showimage();"> <option value="01">头像一</option> <option value="02">头像二</option> <option value="03">头像三</option> </select></td></tr> <tr><td width="450">信箱:<input type="text" name="femail" size=25 maxlength=50>  主页:<input type="text" name="fweb" value="http://"></td><td rowspan=2 align="center" width="230"><img id="fimg" name="fimg" src="face/m01.gif"></td></tr> <tr><td width="450">内容:<textarea name="fnr" rows="5" cols="53"></textarea></td></tr> <tr><td colspan=2 align="center"><input type="button" name="b1" value="提交" onclick="check();">   <input type="reset" name="b2" value="重置"></td></tr> </table></form></td></tr></table> document.f1.fsexy.options[document.f1.fsexy.selectedIndex].value 改为这样了,还是不能行,图片不会换<!--#include file="conn.asp"--><script language="javascript">function check(){if(document.f1.fname.value=""||document.f1.femail.value=""||document.f1.fweb.value=""||document.f1.fnr.value="") { alert("请认真填写"); return false; }else { document.f1.submit(); }}function showimage(){document.f1.fimg.src="face/"+document.f1.fsexy.options[document.f1.fsexy.selectedIndex].value+document.f1.fimage.options[document.f1.fimage.selectedIndex].value+".gif";}</script><%iuser=request.querystring("user")if request.querystring("user")="" or request.querystring="" then response.redirect("reg.asp")else msql="select * from [user] where [user]='"&iuser&"'" set rs=conn.execute(msql) if rs.eof and rs.bof then rs.close set rs=nothing conn.close set conn=nothing response.write("<script>alert('没有此版,请申请');location.href='reg.asp';</script>") response.end else if session("user")=rs("user") and session("pwd")=rs("pwd") then power="ok" else power="" end if end if end if%><table border=0 width="680" align="center"><tr><td><form action="index.asp?user='<%=iuser%>' method="post" name="f1"> <table border=0 width="100%"> <tr><td colspan=2>姓名:<input type="text" name="fname" size=20 maxlength=16>  留言性质:<input type="radio" name="fr" value="r1" checked>公开<input type="radio" name="fr" value="r2">悄悄话   性别:<select name="fsexy" size=1 onchange="showimage();"> <option value="m" selected >男</option> <option value="w">女</option> </select>   表情: <select name="fimage" onchange="showimage();"> <option value="01">头像一</option> <option value="02">头像二</option> <option value="03">头像三</option> </select></td></tr> <tr><td width="450">信箱:<input type="text" name="femail" size=25 maxlength=50>  主页:<input type="text" name="fweb" value="http://"></td><td rowspan=2 align="center" width="230"><img name="fimg" src="face/m01.gif"></td></tr> <tr><td width="450">内容:<textarea name="fnr" rows="5" cols="53"></textarea></td></tr> <tr><td colspan=2 align="center"><input type="button" name="b1" value="提交" onclick="check();">   <input type="reset" name="b2" value="重置"></td></tr> </table></form></td></tr><tr><td><table width="100%" border=0><tr><td><a href="<%=rs("url")%>" target="_blank"><%=rs("user")%></a>>>留言本>>第页            <%if power="ok" then%>【<a href="edit.asp?user=<%=rs("user")%>">修改资料</a>】 【<a href="login.asp?user=<%=rs("user")%>&exit=ok">退出登录</a>】<%else%>【<a href="login.asp?user=<%=rs("user")%>">版主管理</a>】 【<a href="reg.asp">在线申请</a>】<%end if%></td></tr></table></td></tr></table> jquery 前位取值问题 window.open 为什么页面回到最前面 判断字符串里包含多少个数字 绝对秃顶高手.AJAX,sql,php,骇客 技术俱乐部群14471754 如何进行对二者之间的的数量进行比较 js数组分割问题 怎么右键点击 .net web form的datagrid弹出菜单?解决后再放100分,顶着有分 高分求横排的下拉菜单?在线等 如何实现文件上传? 高手才能解决的问题. 怎么禁止使用<和> select box 如何設定為 selected
{
document.f1.fimg.src=eval("face/"+document.f1.fsexy.value+document.f1.fimage.value+".gif"); }
<script language="javascript">
function check()
{
if(document.f1.fname.value=""||document.f1.femail.value=""||document.f1.fweb.value=""||document.f1.fnr.value="")
{
alert("请认真填写");
return false;
}
else
{
document.f1.submit();
}
}function showimage()
{
document.f1.fimg.src=eval("face/"+document.f1.fsexy.value+document.f1.fimage.value+".gif");
document.write(document.f1.fimg.src);
}
</script>
<%
iuser=request.querystring("user")
if request.querystring("user")="" or request.querystring="" then
response.redirect("reg.asp")
esle
msql="select * from [user] where [user]='"&iuser&"'"
set rs=conn.execute(msql)
if rs.eof and rs.bof then
rs.close
set rs=nothing
conn.close
set conn=nothing
response.write("<script>alert('没有此版,请申请');location.href='reg.asp';</script>")
response.end
else
if session("user")=rs("user") and session("pwd")=rs("pwd") then
power="ok"
else
power=""
end if
end if
end if%>
<table border=0 width="680" align="center">
<tr><td>
<form action="index.asp?user='<%=iuser%>' method="post" name="f1">
<table border=0 width="100%">
<tr><td colspan=2>姓名:<input type="text" name="fname" size=20 maxlength=16>  留言性质:<input type="radio" name="fr" value="r1" checked>公开<input type="radio" name="fr" value="r2">悄悄话  
性别:<select name="fsexy" size=1 onchange="showimage();">
<option value="m" selected >男</option>
<option value="w">女</option>
</select>  
表情: <select name="fimage" onchange="showimage();">
<option value="01">头像一</option>
<option value="02">头像二</option>
<option value="03">头像三</option>
</select></td></tr>
<tr><td width="450">信箱:<input type="text" name="femail" size=25 maxlength=50>  主页:<input type="text" name="fweb" value="http://"></td><td rowspan=2 align="center" width="230"><img id="fimg" name="fimg" src="face/m01.gif"></td></tr>
<tr><td width="450">内容:<textarea name="fnr" rows="5" cols="53"></textarea></td></tr>
<tr><td colspan=2 align="center"><input type="button" name="b1" value="提交" onclick="check();">   <input type="reset" name="b2" value="重置"></td></tr>
</table>
</form>
</td></tr></table>
<script language="javascript">
function check()
{
if(document.f1.fname.value=""||document.f1.femail.value=""||document.f1.fweb.value=""||document.f1.fnr.value="")
{
alert("请认真填写");
return false;
}
else
{
document.f1.submit();
}
}function showimage()
{
document.f1.fimg.src="face/"+document.f1.fsexy.options[document.f1.fsexy.selectedIndex].value+document.f1.fimage.options[document.f1.fimage.selectedIndex].value+".gif";
}
</script>
<%
iuser=request.querystring("user")
if request.querystring("user")="" or request.querystring="" then
response.redirect("reg.asp")
else
msql="select * from [user] where [user]='"&iuser&"'"
set rs=conn.execute(msql)
if rs.eof and rs.bof then
rs.close
set rs=nothing
conn.close
set conn=nothing
response.write("<script>alert('没有此版,请申请');location.href='reg.asp';</script>")
response.end
else
if session("user")=rs("user") and session("pwd")=rs("pwd") then
power="ok"
else
power=""
end if
end if
end if%>
<table border=0 width="680" align="center">
<tr><td>
<form action="index.asp?user='<%=iuser%>' method="post" name="f1">
<table border=0 width="100%">
<tr><td colspan=2>姓名:<input type="text" name="fname" size=20 maxlength=16>  留言性质:<input type="radio" name="fr" value="r1" checked>公开<input type="radio" name="fr" value="r2">悄悄话  
性别:<select name="fsexy" size=1 onchange="showimage();">
<option value="m" selected >男</option>
<option value="w">女</option>
</select>  
表情: <select name="fimage" onchange="showimage();">
<option value="01">头像一</option>
<option value="02">头像二</option>
<option value="03">头像三</option>
</select></td></tr>
<tr><td width="450">信箱:<input type="text" name="femail" size=25 maxlength=50>  主页:<input type="text" name="fweb" value="http://"></td><td rowspan=2 align="center" width="230"><img name="fimg" src="face/m01.gif"></td></tr>
<tr><td width="450">内容:<textarea name="fnr" rows="5" cols="53"></textarea></td></tr>
<tr><td colspan=2 align="center"><input type="button" name="b1" value="提交" onclick="check();">   <input type="reset" name="b2" value="重置"></td></tr>
</table>
</form>
</td></tr>
<tr><td><table width="100%" border=0>
<tr><td><a href="<%=rs("url")%>" target="_blank"><%=rs("user")%></a>>>留言本>>第页            <%if power="ok" then%>【<a href="edit.asp?user=<%=rs("user")%>">修改资料</a>】 【<a href="login.asp?user=<%=rs("user")%>&exit=ok">退出登录</a>】<%else%>【<a href="login.asp?user=<%=rs("user")%>">版主管理</a>】 【<a href="reg.asp">在线申请</a>】<%end if%>
</td></tr>
</table></td></tr>
</table>