---
title: "Comment by Mehdi Yaghoubi on \"Replacing oninput with x-mask\" | Hashnode"
description: "and How to save the value of the masked model in the livewire component to the database. the x-mask:dynamic=&quot;$money($input)&quot; is something like 99,100,"
url: "https://hashnode.com/posts/replacing-oninput-with-x-mask/638732935cd93cbec20ad862/comment/6547893008e6f2d0c473be9e"
---

[Discussion](https://hashnode.com/posts/replacing-oninput-with-x-mask/638732935cd93cbec20ad862)

Comment [Replacing oninput with x-mask](https://hashnode.com/posts/replacing-oninput-with-x-mask/638732935cd93cbec20ad862)

[Mehdi Yaghoubi](https://hashnode.com/@mehdi9500)

[Nov 5, 2023](https://hashnode.com/posts/replacing-oninput-with-x-mask/638732935cd93cbec20ad862/comment/6547893008e6f2d0c473be9e)

and How to save the value of the masked model in the livewire component to the database. the x-mask:dynamic="$money($input)" is something like 99,100,200 but I need to save 99100200?

[Anjanesh Lekshminarayanan](https://hashnode.com/@anjanesh)

[Nov 5, 2023](https://hashnode.com/posts/replacing-oninput-with-x-mask/638732935cd93cbec20ad862/comment/6547893008e6f2d0c473be9e#reply-65478b7731ab12d0f49f2a20)

I haven't yet got into Livewire but you could do a replaceAll(',', '') on form submit - bad idea if it's repetitive.

Or

```
<script>
    Alpine.data('x-data', {
        get computedValue() {
            return this.myValue.replace(/,/g, '');
        }
    });
</script>

<span x-text="computedValue"></span>
```
