在html中form中 ,有input 包含中文 ,在跳转的页面中 URL中的 Parameter中文变成了
乱码,下面来看看解决办法。
原因:
html 默认编码方式 iso-8859-1 ,而我们需要的是utf-8编码
解决的方法:
在form标签中 放入
代码如下
复制代码
accept-charset="utf-8" onsubmit="document.charset='utf-8'" 属性实例如下:
<form id="search-box" class="goog-inline-block" target="_blank"accept-
charset="utf-8" onsubmit="document.charset='utf-8'" action="XXX/XXX.aspx">
<label>
我要找:</label>
<input id="G_s" type="text" value="" maxlength="60" size="22"
title="\" name="search_text"
style="color: rgb(0, 0, 0);">
<input id="G_s-btn" type="submit" value="搜索"
style="background-image: url(Image/pics/bt_search.png)" />
</form>