How do i empty an input field after post have been created

What seems to be the problem:

After data have been stored/created in the database i want to empty the input field.

Steps to Reproduce:
The screenshot below contains the process


what i tried doing


I get this error in my browser console after data have been created.

The text input doesn’t get empty.

Are you using the latest version of Livewire:


Do you have any screenshots or code examples:
Added above

I don’t think your problem is in that line. That should work fine. There is something that breaks your js and as a result it doesn’t carry on to empty the content. I don’t have enough information though to see what that bug is.

1 Like

Does your textarea have an actual name attribute?

1 Like

No, none at all…

<textarea style='height: 10%; padding-right: -23px;' wire:model="content" class="form-control" placeholder="What’s on your mind"></textarea>

here is a screenshot of the line throwing me an error in my console…

I’m suggesting that you might need a name?

I added that it’s still the same issue

Can you post the entire contents of your Blade view? These errors usually happen when the dom-diffing can’t keep track of elements because of a top level conditional in Blade.

Read this page for more info as well:

here is the file

Profile picture
                            <span class="badge badge-secondary" id="imageIcon">
                                <img  src="{{asset('img/camera.png')}}" class="img-fluid" alt="icon" style="width: 11px;">
                            <span class="badge badge-secondary" id="locationIcon">
                                <img src="{{asset('img/location.png')}}" class="img-fluid" alt="icon" style="width: 11px;">
                            </span><span id="locationData" style="font-size: 12px;"></span>
                       <input type="hidden" wire:model="location" id="locationPost">
                            {{--  <input type="hidden" id="userId" wire:model="user_id" value="{{Auth::user()->id}}" />  --}}
                        <input style="display:none" accept=".png, .jpg, .jpeg"  multiple type="file"  id="addPhotos"  />
                        <button  wire:loading.attr="disabled" wire:click="addPost" class="btn btn-info btn-add pull-right" style="float: right">Post</button>
                <span id="displayImage"></span>

I am using a single (page ) component.
livewire spa mode