Fraz Anjum
Fraz Anjum

Reputation: 151

Cakephp dropdown selected value not coming correctly in firefox when a page is refreshed

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.

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

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
            )
        );

Any answers would be highly appreciated.

Upvotes: 1

Views: 1763

Answers (2)

Vinayak Phal
Vinayak Phal

Reputation: 8919

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.

Its not a Cakephp issue.

Upvotes: 3

Jason McCreary
Jason McCreary

Reputation: 72981

This is something particular to Firefox, not CakePHP. It caches some of the form data unless you hard refresh.

Upvotes: 3

Related Questions