Masked jquery input

I tried to mask the text box and looked at http://digitalbush.com/projects/masked-input-plugin/

Has anyone used this plugin before?

I am trying to mask a text box so that users can enter a certain amount in dollars into it. the dollar may be between 0 - 500000

Is this possible through this plugin?

+4
source share
4 answers

A masked input plugin can contain only fixed-length fields. It can also perform partial inputs, but only at the end of the field.

+4
source

Trying to mask for a range is just annoying to users. Instead, use the blur event to check the range when the focus leaves the text box.

$('#yourinput').blur(function() { val dollarAmount = parseInt($(this).val()); if (dollarAmount < 0) { $(this).val(0); } elseif (dollarAmount > 500000) { $(this).val(500000); } }); 
+2
source

I liked working with the connected input plugin and I wanted to create the same thing. I agree with Aaron above that I do not believe that the jBush Masked Input plugin supports it, which I can find. Although I think jBush was looking for this: http://forum.jquery.com/topic/jquery-masked-input-plugin-direction

I was looking for the same thing. So far, the closest I have found to which I am currently referring is the alphanumeric plugin: http://itgroup.com.ph/alphanumeric/

To solve your question, you can set it to allow only numeric, plus a few extra ones (comma, decimal).

+1
source

All the plugins that I found have some trouble or strange behavior (the cursor jumps to the end, the text cannot be selected using the shift + keys, etc.), but this one has the smallest of these problems that I could to find:

https://github.com/plentz/jquery-maskmoney

Sorry to dig this old thread, but I ended up using this plugin, it might be useful if someone stumbles on this topic (like me)

+1
source

All Articles