Content format text (only text)

How can i put a input with content format, this way: text (only text)

Could you clarify a bit further? Do you mean only allow standard alphabet characters? (Ie. no symbols like “%” or numbers like “783”)

Not sure that Bubble has any pre-built setting to restrict to alphabet characters only. But perhaps possible using regex or a plugin to strip out non-compliant characters.

1 Like

is about numbers like"783"
I dont wanna the input allow numbers.

Yep, then you’d likely want to use regex. (If you’re not familiar, regex is a utility that removes certain characters from typed text. There are a handful of posts on the forum that explore it in a bit more detail). However, it wouldn’t work in the same form as the text (numbers only) does in blocking that character from being typed in the box.

I may wait for some others to chime in with solutions in the meantime.

1 Like

Its very strange for bubble dont have this type of content format. Bubble is strong, but this type of things make me think if bubble is good for build a complex application or not. =/ I am building a complex ERP ,reports, BI, system with bubble.

Thank u
And i wish bubble get a solution for this, cos have Content format Text( numbers only) and dont have Text(text only) is nonsense.

The thing you’re missing is that “text” just means “the ASCII character set”. The glyphs representing numbers are text. Emojis are text. Etc.

If you want to do special manipulations, you can do them, as @dan1 notes.

(The general name for the thing one is selecting in the “Content Format” pulldown is called an “input mask”. The array of potential input masks is essentially infinite, so it should not be surprising that Bubble doesn’t have built-in input masks for every possible situation.

Note that you could get yourself over to the bug report page and file a request-for-enhancement, asking for a “Text (a-z A-Z only)” content format. That would probably be an easy enhancement that Bubble could add.

That being said, would it be cool to be able to define one’s own input masks? Sure it would. But that would be an advanced feature and you’d probably gripe about that, too.

It’s possible that someone will chime in here with a cool solution for an alpha-only input mask. Again, as @dan1 notes, you can do all sorts of things with the input value when its value changes. For example, another common input type is for URLs and there’s all sorts of error checking that one might want to do in such an input field.

Using workflows, you can correct for common errors that humans make in such situations. For example, I have a place in my app where there’s a text input where the user should paste or type a URL. When the input changes, I do checks like "does this text represent a fully-qualified URL [check for if it starts with http:// or https://], trim preceding and trailing whitespace [using the :trimmed operator], etc.

And, based on what we find, we can either auto-correct the value or prompt the user to retry with some helpful info about what they might have done wrong.

BUT, back to my original and more core point: One could argue that there’s NO NEED to for an input mask for “Text (no numbers)” because there is in fact NO SUCH THING.

“Text (no numbers)” is NOT the converse of “Text (numbers only)”. “Text (numbers only)” has a very specific use case: You’d use it when the value is going to be converted to a numeric data type and you want to make sure that that conversion doesn’t go wrong.

However, if you have an input field that’s for some kind of data label (for example) that’s text (meaning the string data type), all of these are perfectly valid strings:

“Keith”
“keith”
“:pizza::grinning::kick_scooter:”
“invoice”
“data label 15”
“12345”
“1 my field 2”
“Björk Guðmundsdóttir”

It may be your preference for some user-entered text value to not have “special characters”, but there’s no technical reason to do so. Your app would function just fine whether you allow them or not.

We see variations on this question/comment pretty regularly here in the forum. My take on it is, “Dear OP, you misunderstand what a string is.”

2 Likes

And just to prove the point, here’s a really cool app called Bubble that handles data labels the right way. :wink: Bubble allows you to create custom data types composed of fields of various primitive data types and the names for those are texts. So you can create a data type with a bunch of fields where the names of those fields might be surprising:

Once created, those data labels propagate across the app just fine. Here’s what happens when you create a new thing of the data type shown above, where I open the expression boxes for setting the values of the various fields:

See? Special characters are no problem (as it should be)!

1 Like

its all awesome. really.

But i did not undestand how i will do a input that dont allow numbers

Thanks for all

Well, my point was: “Why do you need to do that at all?”

But the answer to your original question again: There’s no input mask for this, but you can filter the text input’s value to strip out any digit characters using :find and replace and RegEx. Like this:

In run mode:

2 Likes

I need do it, cos are one buisiness rule .
I cant allow numbers on those input.

Thanks a million @keith

1 Like

if all run good, i will have a paid plan soon, is possible bubble add for my application, the feature of “Text (a-z A-Z only)” content format? =D

I have no idea. File a bug report.

1 Like

Thanks =), i will do it. @keith

This topic was automatically closed after 70 days. New replies are no longer allowed.