0

MypolicyInfoActionはフォームを にリダイレクトしclientInfoActionます。空のフィールド エラーを格納し、セッション変数のフィールドを検証して、client-infoエラーが含まれている場合はページにリダイレクトします。それは正常に動作します。しかし、問題は、次に/client-info新しいタブでページにアクセスしたときに、フィールドにフォームの値が表示されることです。それをクリアするには、ページを更新する必要があります。リンクを新しいタブで開いたときに、キャッシュされたデータを表示したくありません。私は何をすべきか?

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

これが私の見解です:

<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