0

My policyInfoAction redirects my form to clientInfoAction. It stores the empty field errors and then validates the fields in the session variables and redirects it to the client-info page if it contains errors. It works fine. But the problem is the next time I hit the /client-info page in a new tab it shows the form values in the fields. I have to hit the refresh page to clear it out. I do not want it to display cached data when I open the link in a new tab. What should I do?

public function clientInfoAction(){
    //If there are some errors and some valid fields, display the valid fields
    $client=$this->session->client;
    $state=$this->session->state;
    unset($this->session->client, $this->session->state); // delete from the 

    // assign the values to the view
    $this->view->client = $client;
    $this->view->state  = $state;
}

Here is my view:

<form action ="/pdp/policy-info/" method='post'">

    <label for="client_name">Client Name:  </label>
    <input type="text" name="client_name" id="client_name">
    <?php if (!empty($this->client_error)) echo "<font size='2' color ='#C11B17'>".$this->client_error."</font>"; ?>
    <br><br>

    <label for="state">State: </label>
    <select name="state" id='state'>
        <option id='state' value="" selected="selected"></option>
4

0 回答 0