【网站开始和运营】 html文件中的form提交数据时中文乱码现象解决
在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>
posted on 2011-10-12 21:46 狗尾草-大数据收割基 阅读(1111) 评论(1) 编辑 收藏 举报