You can use this library https://github.com/BankFacil/vanilla-masker
fanjavaid said:
You can use this library https://github.com/BankFacil/vanilla-masker
Thanks, I will try it and give you my feedback.
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
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();
})
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community