question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Retrieve mask applied?

See original GitHub issue

TL;TR It’s possible/exists a way to retrieve the mask applied to an object, and save on a var, to use it when calling again to inputmask(myvar)?

In my project I extend numeric alias to get my own for euro symbols, this way:

Inputmask.extendAliases({
	euro: {
            suffix: " €",
            groupSeparator: ".",
            radixPoint: ",",
            alias: "numeric",
            placeholder: "0",
            autoGroup: !0,
            digits: 2,
            digitsOptional: !1,
            clearMaskOnLostFocus: !1,
            autoUnmask: true,
            removeMaskOnSubmit:true,
            unmaskAsNumber: true
            }
        });

In some inputs, I “overwrite” when calling input mask, adding more digits or other configs, and all is working like a charm, like this:

    $j('#totalDocumento').inputmask('euro', { rightAlign: false });
    $j('td[id*="baseImpon"]').inputmask('euro', {digits: 4 });
    $j('td[id*="dto1"]').inputmask('euro', {suffix: ' %' });

Right now, I apply a mask to a table’s td, and when double click, I create an input with the value (editable grid), and I want to apply the same mask of the cell clicked, to the input, but I want to get it in some way, because I’m doing a function for generic use.

Issue Analytics

  • State:open
  • Created 7 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
thomeycommented, Dec 16, 2016

It’s because you’re calling .inputmask on a jQuery object. myObject[0].inputmask.userOptions will return what you want.

0reactions
devgiucommented, Nov 28, 2016

I’m too busy this days, but I will try to replicate on JS fiddle and give more details.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Is there a way to get an applied input mask from an element?
I'm trying to get the input mask that was applied to different elements using Josh Bush's Masked Input Plugin (https://github.com/digitalBush/jquery.maskedinput) ...
Read more >
Select and Mask workspace - Adobe Support
Launch the Select and Mask workspace · Choose Select > Select and Mask. · Press Ctrl+Alt+R (Windows) or Cmd+Option+R (Mac). · Enable a...
Read more >
Extract by Mask—Help | ArcGIS for Desktop
ArcGIS geoprocessing tool that extracts the cells of a raster corresponding to the area defined by a mask.
Read more >
How to Use a Face Mask: Instructions to Apply and Remove
Find a facial cleanser designed for your skin type and use it liberally before applying your face mask. Cleansing can help prepare your...
Read more >
Control data entry formats with input masks - Microsoft Support
Important: This article only applies to Access desktop databases. Access web apps and web databases do not support input masks.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found