According to the conditions of my project, I want to use the IF command inside the html body tag, the parameter of the IF condition is the tag being empty. I have to do this because the html code will change based on the condition. How can I write the condition to check the input tag null value.
@if (checking value of office_id))
<div>update code</div>
@else
<div>store code</div>
@endif
...
<div>
<input id="office_id" class="myform-control">
</div>
2
Answers
You could use JavaScript or jQuery to listen for changes on the input field, and then show or hide different parts of your HTML based on the input value.
You can use Livewire with blade here just use
wire:model.lazy
Read more about this :
https://laravel-livewire.com/docs/2.x/properties