nuna's avatar
Level 1

How to make the message disappear without the user refresh the page?

<div class="col-9 col-xl-9 col-lg-9 pt-4 pr-0">
                        @if($errors->first('success'))
                        <div class="pb-1 text-success">{{ $errors->first('success') }}</div>
                        @endif
                        @if($errors->first('warning'))
                        <div class="pb-1 text-warning">{{ $errors->first('warning') }}</div>
                        @endif
                        <div class="tab-content collapse-inner2 mt-0">
                            <!--My Account-->
                            @include('_partial._myaccount')
                            <!--My Account-->

                            <div class="tab-pane fade text-left" id="myaddresstab" role="tabpanel"
                                aria-labelledby="myaddresstab">
                                <!--My Address-->
                                @include('_partial._address')
                                <!--My Address-->
                            </div>

Right once the condition is succussfull.There is pop up coming out but it stays ther till the user refresh the page.Please help.How to fix this.

0 likes
2 replies
automica's avatar
automica
Best Answer
Level 54

@nuna you'll need some JavaScript for that:

setTimeout(function() {

      // Do something after 3 seconds
      // This can be direct code, or call to some other function

	$('#alert').hide();

     }, 3000);

the above will hide an element with id = alert after 3 seconds, Example in jQuery.

1 like

Please or to participate in this conversation.