Forum Documentation Showcase Pricing Learn more

New Plugin - Input Formatter


#1

I’ve gone a bit plugin mad the last few days. Here’s my latest, Input Formatter.

You can use it to format an Input box, live, as the user types. Eg. For inserting spaces between credit card numbers, slashes between MM/YY dates, commas between thousands, etc.

You can set custom formatting options, custom delimiters and prefixes.
You can convert text to uppercase or lowercase.
You can also return the unformatted input string.

Demo here: https://plugindemos.bubbleapps.io/version-test/inputformatter
Edit mode: https://bubble.is/page?type=page&name=inputformatter&id=plugindemos&tab=tabs-1

Available now, search for Input Formatter in the plugins menu. Let me know what you think!


Extract parts of string with Regex
Formating number input's punctuation
#2

At least someone did it! Thanks :wink:


#3

Sounds useful.


#4

Awesome man!

Thanks for that.


#5

Very cool thanks!


#6

Simple and effective! Thanks dambusmedia. Great job.


#7

Nice, I’ve been waiting for this!! Super cool :slight_smile:


#8

Very nice! I’ve just installed it for a checkout page :slight_smile:


#9

yup thats what i ordered, thanks


#10

Nice! Love the concept. Will have to give it a whirl.


#11

Hey there,

Love the plugin and was developing the same with the same js library but there is a problem (that’s why I stopped using it) and hope you solved it so I can also be a user of this.

The problem is in loading default values as they are not formatted. Also extracting the result of the inputted data in a none formatted method.

Where you able to solve this?


#12

Hey, thanks for the feedback!

The plugin has the ability to return the input’s data unformatted, if you want to store it that way. But I hadn’t considered default values! Just checked and you’re right, they were going unformatted.

I’ve just pushed an update to fix this:

There’s two ways people could be using the data from this, they could either want to save the raw input, unformatted, or they could want to save it formatted. So you’ve got two options depending on what you’re doing:

I’ve added a property to the Input Formatter element that will accept an unformatted default value. Use that if you’re saving data unformatted and the Input will show it formatted on page load. If you’re saving data that’s formatted, just use the regular Input element’s default value settings. :grinning:

Btw, if you’ve installed this plugin already, you’ll need to update it in the plugin tab (and maybe refresh the editor).


#13

Bit off topic here, but playing around with this I’ve just realised I can’t seem to find an option in Bubble to convert a string to a number… has this always been the case? Could have sworn there was an operator for that.

Right now this plugin lets you access the unformatted input value as a Text, think I should also include an option to get it as a Number?


#14

You can convert it to a number by passing it through a separate input field with number as content format. Not very slick, I know, but I’ve used it a few times.

Not sure if this helps in this particular instance though.


#15

@dambusmedia Very impressive ! Useful plugin. Thank you very much !


#16

@dambusmedia
Hi! I just realized that if you set the Content Format to Text (numbers only) in the Input Field, the formatting doesn`t work. Is there a way around this?

Using the Text (numbers only) is useful to show only numbers in the keyboard on mobile.


#17

@dambusmedia
Your plugin was a great idea! The credit card format is especially useful!

I’m not really sure how to use the “custom” option, however.


#18

Yeah, seems a shame there’s no built in string to number converter. Well, I’ve added an option to the plugin to return the unformatted value as a Number anyway.


#19

You’re right, that’s not working. I don’t think I’m going to be able to fix that as I think Bubble is applying their own input formatting to the input to prevent non-numeric characters, which is overriding the plugin.

What you can do is set the input box content type to Integer or Decimal, which will give you only numbers in the keyboard. However, when you’re saving the data from the input box, Bubble will treat it as a Number and ignore anything after a space or other delimiter. So you have to instead save the Input Formatter’s Unformatted Input value.


#20

I’ll try that out, thanks! :metal: