隧道交通标志:提交表单后获取的数据出现乱码如何解决?

来源:百度文库 编辑:神马品牌网 时间:2024/04/29 10:05:40
代码如下:
test1.asp
<table width="300">
<form name="ad" method="post" action="">
<tr>
<td><input name="filepath" size="30"></td>
</tr>
</from>
<tr>
<td><iframe src="test2.asp"></iframe></td>
<tr>
</table>

test2.asp
<script language="javascript">
function fill(fpath){
paremt.ad.filepath.value=fpath;
}
</script>
<table width="300">
<form name="test" method="post" action="">
<tr>
<td>
<%
filepath="\files\pic\1.jpg"
response.write filepath
%>
<input name="filepath" type="hidden" value="<%=filepath%>">
<input name="submit" type="button" value="提交" onclick="javascript:fill(<%=filepath%>);">
</td>
</tr>
</form>
</table>

将字符串中的"\"转换成"/"即可