Home >Backend Development >PHP Tutorial >两级联动select刷新后其值保持不变的实现方法_PHP

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

WBOY
WBOYOriginal
2016-06-01 11:56:44963browse

背景

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

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

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

Statement:
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