0

I have some issues when going back from my page. This is my view. There is a default value in "a" tag, if user clicks on that element list opens and user selects an option, after that I go to that options's page. If I click back, I get to the page with default value, but it should show chosen option's value from browser's cache?

<a href="#" class="custom-select-opener js-spec-select_name usrtype">{{ $user_types[$def_key] }}</a>
<div class="custom-select-scroll nano">
    <div class="nano-content">
        <ul class="custom-select-dropdown">
            @foreach ($user_types as $k=>$v)
                <li class='js-spec-select_li' data-id='{{ $k }}'>{{ $v }}</li>
            @endforeach
        </ul>
    </div>
</div>

Thinking about using Session

linktoahref
  • 7,812
  • 3
  • 29
  • 51
dosss
  • 3
  • 2
  • while redirecting back you can pass the parameter chosen by the user in Querystring and on page load update the anchor from the parameter in the querystring before page loads, that's the only option I see, but if you use html input fields then you will be able to do **Redirect back withInput()** option check [this Question](http://stackoverflow.com/questions/31081644/how-to-redirect-back-to-form-with-input-laravel-5) to redirect back with input... – Akshay Khale Apr 27 '17 at 05:50
  • @AkshayKhale the problem is that i'm redirecting back with browser back option, not with the help of laravel. And I don't think when I redirect back the querystring will appear – dosss Apr 27 '17 at 05:53
  • Then on next page you can store the input in session parameter and in the blade you can simply load anchor from the session and clear the session... – Akshay Khale Apr 27 '17 at 05:55

0 Answers0