easyui-combobox样式 谷歌浏览器history.back(),无法保存值

zhoutm 2017-03-01 09:54:33
提交页面代码
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="../inc/themes/user_defined/easyui.css">
<link rel="stylesheet" type="text/css" href="../inc/themes/icon.css">
<script language="javascript" src="../js/jquery.min.js"></script>
<script type="text/javascript" src="../js/jquery.easyui.min.js"></script>
<title>无标题文档</title>

</head>

<body>
<?php

?>
<form action="com.php" method="post" enctype="application/x-www-form-urlencoded" name="form1" id="form1">
<select name="select" id="select" class="easyui-combobox">
<option value="5">1</option>
<option value="2">2</option>
<option value="4">3</option>
</select>
<input type="submit" name="button" id="button" value="提交" />

</form>
</body>
</html>

接受页面代码

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>

<body>
<script language="javascript">

window.history.back();


</script>

</body>
</html>
下拉菜单选择2,并提交页面,接受页面返回上一页后,select值变成1,而不是2,而IE浏览器无此问题。
easyui1.5.1版本
利用谷歌浏览器开发工具检测发现 easyui 将select替换成了div的格式进行显示。
下面是谷歌开发工具显示的运行中的页面代码,试过了easyui的1.3.6版本也是这样。

<html xmlns="http://www.w3.org/1999/xhtml"><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="../inc/themes/user_defined/easyui.css">
<link rel="stylesheet" type="text/css" href="../inc/themes/icon.css">
<script language="javascript" src="../js/jquery.min.js"></script>
<script type="text/javascript" src="../js/jquery.easyui.min.js"></script>
<title>无标题文档</title>

</head>

<body>
<form action="com.php" method="post" enctype="application/x-www-form-urlencoded" name="form1" id="form1">
<select id="select" class="easyui-combobox combobox-f combo-f textbox-f" textboxname="select" style="display: none;" comboname="select">
<option value="5">1111</option>
<option value="2">22222</option>
<option value="4">33333</option>
</select><span class="textbox combo" style="width: 57px;"><span class="textbox-addon textbox-addon-right" style="right: 0px; top: 0px;"><a href="javascript:;" class="textbox-icon combo-arrow" icon-index="0" tabindex="-1" style="width: 18px; height: 33px;"></a></span><input id="_easyui_textbox_input1" type="text" class="textbox-text validatebox-text" autocomplete="off" tabindex="" placeholder="" style="margin: 0px 18px 0px 0px; padding-top: 0px; padding-bottom: 0px; height: 33px; line-height: 33px; width: 31px;"><input type="hidden" class="textbox-value" name="select" value="5"></span>
<input type="submit" name="button" id="button" value="提交">

</form>

<div class="panel combo-p" style="position: absolute; z-index: 10; display: none;"><div class="combo-panel panel-body panel-body-noheader" title="" id=""><div id="_easyui_combobox_i1_0" class="combobox-item combobox-item-selected">1111</div><div id="_easyui_combobox_i1_1" class="combobox-item">22222</div><div id="_easyui_combobox_i1_2" class="combobox-item">33333</div></div></div></body></html>



...全文
171 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
Ny-6000 2017-03-02
  • 打赏
  • 举报
回复
easyui把全部用到的控件都套了一层又一层的. 实际用到的和界面显示的已经是2回事了.
当作看不见 2017-03-01
  • 打赏
  • 举报
回复
sessionStorage 这个东西你值得拥有
资源下载链接为: https://pan.quark.cn/s/22ca96b7bd39 在前端开发领域,EasyUI 是一款基于 jQuery 的用户界面框架,它为开发者提供了丰富且美观的组件,用于构建交互式的网页界面。其中,easyui-textbox 和 easyui-combobox 是两个非常实用的组件。easyui-textbox 是一个增强版的输入框组件,它在原生 HTML 的 input 元素基础上增加了更多功能和样式。而 easyui-combobox 则是一个下拉选择框组件,允许用户从一个预定义的选项列表中进行选择。这两个组件在网页表单中非常常见,常用于收集用户输入的数据。 onchange 事件是 JavaScript 中一个重要的事件,它会在元素的发生变化并且失去焦点时触发。在 EasyUI 中,easyui-textbox 和 easyui-combobox 都支持 onchange 事件,可用于监听用户操作并进行相应的处理。以下是一个简单的示例代码,展示了如何使用 onchange 事件与这两个组件进行交互: 在这个示例中,我们创建了一个 easyui-textbox 输入框和一个 easyui-combobox 下拉选择框。对于输入框,我们通过 onchange 属性直接绑定了一个名为 handleTextboxChange 的函数,该函数会弹出一个警告框显示当前输入框的。对于下拉选择框,我们使用了 data-options 属性中的 onChange 键来指定处理函数 handleComboboxChange,该函数接收新旧作为参数,并弹出警告框展示的变化。

87,993

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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