RobinHerbots / Inputmask

Input Mask plugin
https://robinherbots.github.io/Inputmask/
MIT License
6.4k stars 2.17k forks source link

data-inputmask-allowminus="true" not run #1413

Open mbraz opened 8 years ago

mbraz commented 8 years ago

Hi,

I use:

(...)

<input type="text" class="form-control text-align-right name="{$id}" value="{$value}" maxlength="5" data-inputmask-mask="9{0,3},9{0,1}" data-inputmask-clearmaskonlostfocus="false" data-inputmask-showmaskonhover="false" data-inputmask-greedy="false" data-inputmask-numericinput="true" data-inputmask-allowminus="true" data-inputmask-radixpoint="," autocomplete="on"

But the minus signal (-) is not permitted on field, How to I use minus signal on field?

Marcelo

RobinHerbots commented 8 years ago

@mbraz ,

The data-inputmask-allowminus="true" is a options from the numeric alias.

You need to forsee it in your mask.

Something like [-]9{0,3},9{0,1}

mbraz commented 8 years ago

Hi @RobinHerbots ,

I tested [-]9{0,3},9{0,1}, but the result is not cool...

Please, send-me a sample how to use data-inputmask-allowminus with numeric alias.

Thanks

mbraz commented 8 years ago

Hi @RobinHerbots ,

I changed code to...

<input type="text" class="form-control" id="{$id}" name="{$id}" maxlength="5" data-inputmask="'alias': 'numeric', 'groupSeparator': '.', 'decimalProtect': true, 'autoGroup': true, 'digits': 1, 'digitsOptional': false, 'prefix': '', 'placeholder': '0', 'radixPoint': ','" />

It's running, but I need enter values from -999,9 to 999.9... if enter "-" the max value permited as -99,9 because the content have 5 position including the character "-".

It's a very problem for me...

:)

RobinHerbots commented 8 years ago

@mbraz ,

Which version do you use?

mbraz commented 8 years ago

@RobinHerbots ,

3.3.2-115

:)

RobinHerbots commented 8 years ago

remove the maxlength attrib and use the min and max options

Op wo 12 okt. 2016 om 15:49 schreef mbraz notifications@github.com:

@RobinHerbots https://github.com/RobinHerbots ,

3.3.2-115

:)

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/RobinHerbots/Inputmask/issues/1413#issuecomment-253218514, or mute the thread https://github.com/notifications/unsubscribe-auth/AATb78oIZAOYLxWlyuVhOYuFkz-nrUwYks5qzOVqgaJpZM4KTKV9 .

mbraz commented 8 years ago

@RobinHerbots ,

I update the plugin to last version, remove maxlength and use max option, but the effect is strange.

<input type="text" class="form-control" id="{$id}" name="{$id}" data-inputmask="'alias': 'numeric', 'groupSeparator': '.', 'decimalProtect': true, 'autoGroup': true, 'digits': 1, 'digitsOptional': false, 'prefix': '', 'placeholder': '0', 'radixPoint': ',', 'max': '999,9', 'min': '-999,9'" />

The input not limit the number of characters (because not have maxlength) and when exceed the number, the value is changed to max or min option value.