Support the ongoing development of Laravel.io →
Blade Forms Validation
Last updated 1 year ago.
0
Last updated 8 years ago.
0

fanjavaid said:

You can use this library https://github.com/BankFacil/vanilla-masker

Thanks, I will try it and give you my feedback.

0

fanjavaid said:

You can use this library https://github.com/BankFacil/vanilla-masker

After testing, i'm facing the same problem,

tested after dd(Input::all()), this as what i got :

 "client_id" => "13"
 "date_enc" => ""
 "facture" => "003/2015"
 "type_enc" => "Virement"
 "ref_enc" => ""
** "amount" => "150.000,00" **
 "notes" => "".

as you can see, the "amount" input is still formatted when the form is submitting.

I want to mask the input only in the view (for the UX).

Thanks

Last updated 8 years ago.
0

fanjavaid said:

You can use this library https://github.com/BankFacil/vanilla-masker.

Hallelujah, problem resolved.

the trick is to apply the vanilla-masker function "unmask" to the input while the form is submitting. Like so

	$(document).ready(function(){
			VMasker(document.querySelector("#montant")).maskMoney();
    });
    $("#form").submit(function(){
        VMasker(document.querySelector("#montant")).unMask();
    })

0

Sign in to participate in this thread!

Eventy

Your banner here too?

Boufel boufel Joined 7 Sep 2015

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.