刷新页面时,Cakephp下拉列表中选择的值在firefox中无法正确显示 [英] Cakephp dropdown selected value not coming correctly in firefox when a page is refreshed

查看:150
本文介绍了刷新页面时,Cakephp下拉列表中选择的值在firefox中无法正确显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在设置一个下拉选择的值从firefox的控制器只返回一个错误..我使用cakephp 1.3。

I'm having error in setting up a drop down selected value returned from a controller in firefox only.. Im using cakephp 1.3.

首次加载页面,但如果我改变下拉值和刷新页面的值不改变。

It comes right when i first time load the pages but if i change the drop down value and refresh the page the value doesnt changed. It should be the one coming from controller.

但是当我按下ctrl + f5时,会显示正确的值。

But when i press ctrl+f5 the right value is showed up.

我想这是与浏览器缓存有关。
在Google Chrome中没有此问题。

I guess it is something to do with the browser cache. Im not having this problem in google chrome.

使用此代码将所选值设置为下拉菜单的值

im setting the value of the dropdown with selected value using this code

echo $this->Form->input('to_country_code',array(
            'options'=>$countries,
            'id'=>'to_country_code',
            'label' => __('Country',true),
            //'selected'=>$selectedCountryCode
            'div' => false,
            'default'=>$selectedToCountryCode
            )
        );

任何答案将非常感激。

推荐答案

Firefox刷新页面时会保留您的表单值,毫无疑问它会反映更改。它只是帮助用户不要丢失已经输入的输入。但是如果你点击地址栏,然后按回车,整个页面将会加载初始值。

Firefox will retain your form values when you refresh the page, no doubt it will reflect the changes. Its only to help users for not to loose the input which is already entered. But if you click on the address bar and press enter then entire page will be loaded with initial values.

它不是Cakephp问题。

Its not a Cakephp issue.

这篇关于刷新页面时,Cakephp下拉列表中选择的值在firefox中无法正确显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆