laravel-splade
laravel-splade copied to clipboard
Update x-splade-input when other form is changed
can we do onchange event in input? to update others input value?
Not tested, but I think this should work:
<x-splade-form>
<x-splade-input name="quantity" v-on:change="form.total = form.quantity * form.price" />
<x-splade-input name="price" v-on:change="form.total = form.quantity * form.price" />
<x-splade-input name="total" />
</x-splade-form>
Or:
<x-splade-form>
<x-splade-input name="quantity" v-on:change="form.$put('total', form.quantity * form.price)" />
<x-splade-input name="price" v-on:change="form.$put('total', form.quantity * form.price)" />
<x-splade-input name="total" />
</x-splade-form>
Cool, 2 options is work. thanks a lot.
how about number format?