I Want The Browser Back Button To Take Me To The Previous Page As I Left It

Hi there,

I have a page where I can search and display clients. I want the user to select at least 3 clients (checkboxes) and click a button ‘continue’ to go to the next page. If there are less than 3 clients selected I display an error message.

Now consider the following scenario: I select 2 clients, press ‘continue’ (error message displayed), select a 3rd one, click ‘continue’ (land on the next page) and click the back button. I will be taken to the screen with the 2 selected clients and the error.

That makes sense since it was the previous url in the browser …

So my question is how do I make sure that when I go back I can see no errors and the seleced 3 clients? I am doing everything with GET (as Firefox bothers me with ‘Document expired’ with POST).

Thank you

Renaud

store datas in SESSION

maybe you can use CJSON

you have 3 selected value, and gathered into an array:

$vals = array(

‘selected1’ => $_POST[‘val1’],

‘selected2’ => $_POST[‘val2’],

);

Yii::app()->user->setState(‘form1’, CJSON::encode($vals));

and, also check it

if(Yii::app()->user->hasState(‘form1’)){

$vals = CJSON::decode(Yii::app()->user->getState(‘form1’));

}