RoyGoode's avatar

Livewire don't send request to bind the textarea

why in this case i cant bind textarea in to the $input livewire don't send any request!?

                            @auth
                                @include('layouts.errors')
                                <form wire:submit.prevent="sendComment">
                                    <div class="form-group my-4">
                                        <label for="comment" class="p-r-mute">leave a comment</label>
                                        <textarea id="comment" wire:model="input" class="form-control" placeholder="type.." rows="4" required></textarea>
                                    </div>
                                    <button type="submit" class="btn-get-primery">send</button>
                                </form>
                            @endauth

class :

class SingleSerial extends Component
{
    public $model;
    public $input;
    public $parent_id = '0';

    public function mount(Series $seriesSlug)
    {
        $seriesSlug->increment('viewCount');
        SEO::setTitle(strip_tags($seriesSlug->title));
        SEO::setDescription(strip_tags(str::limit($seriesSlug->body , 250)));
        SEOMeta::setKeywords(strip_tags($seriesSlug->keyWords));
        OpenGraph::addProperty('type', 'Series');
        OpenGraph::addImage(asset('storage/'.$seriesSlug->imageUrl));
        $this->model = $seriesSlug;
    }

    public function render()
    {
        return view('livewire.single.single-serial' , [
            'comments' =>  $this->model->comments()->where('approved' , 1)->where('parent_id', 0)->latest()->with('comments')->paginate(15)
        ]);
    }
}

0 likes
3 replies
Snapey's avatar
Snapey
Best Answer
Level 122

does your view file have a single root element?

have you installed livewire scripts and livewire styles in your view?

RoyGoode's avatar

@snapey yes this is my app.blade :

single root means the view have a div first? ahh no! :)

<!DOCTYPE html>
<html lang="en" xmlns:livewire="http://www.w3.org/1999/html">
<head>
    <meta charset="UTF-8">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    {!! SEO::generate() !!}
    <link rel="stylesheet" href="/css/app.css" type='text/css'>
    <link rel="stylesheet" href="/css/web.css" type='text/css'>
    @yield('styles')
    @livewireStyles
</head>
<body>
<div wire:offline>
    <div class="full-height">
        <div class="d-flex justify-content-center align-items-center">
            <h1 class="h1-c">
			you .....
            </h1>
        </div>
    </div>
</div>
@include('layouts.navbar')
    @yield('content')
@include('layouts.footer')
<script src="/js/app.js"></script>
<script src="/js/web.js"></script>
@yield('script')
@include('sweet::alert')
@livewireScripts
</body>
</html>


RoyGoode's avatar

@snapey thank you! i add a div to the view :)) why i forget to use that...

Please or to participate in this conversation.