Home > php教程 > php手册 > body text

两级联动select刷新后其值保持不变的实现方法

WBOY
Release: 2016-06-06 20:25:17
Original
1296 people have browsed it

两级联动select刷新后,select值保持不变即点击提交按钮后,页面select中继续维持提交前的值,下面有个不错的示例,大家可以参考下

背景

还是学院和专业的关系,我需要保持点击提交按钮后,页面select中继续维持提交前的值

网上有几种办法,要么通过url跳转时候附带参数形式传回页面,或者提交时候讲select的值保存在cookie中,,提交后再把cookie中的值填回select中。

我是按照保存在cookie中的方法实现刷新后select值不变,对select设置一个onchange事件

复制代码 代码如下:



Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!