I have a text input field and I want to only show the first three characters as the user types and followed by asterisks *
It’s like a password input but the first three characters are visible
I have a text input field and I want to only show the first three characters as the user types and followed by asterisks *
It’s like a password input but the first three characters are visible
if it’s just a visual thing you could achieve it with a little trickery
create a group
put 2 inputs in it
input 1 is disabled and shows the groups text truncated from end 3 characts (gets the last 3 characters). then use just add ********123 for the inputs initial value
when clicked reveal the input that they can edit and show a save button
when saved hide the editable input and show the hidden input
this would be fine if it isn’t sensitive information since the data still exists on the page and could be seen in console. if it’s sensitive information you’d want to think about securing it better
But the tricky part is replacing the input value with the exact number of asterisks. I’m having trouble with that.
To create a text input field where the first three characters are visible and the rest are replaced by asterisks, matching the original text length, you can use a combination of text functions.
Input Text's Value:truncated to 3
.:number of characters
function to get the total length of the text.Input Text's Value:truncated to 3 & repeat("*", Input Text's Value:number of characters - 3)
.repeat("*", n)
function is a way to create a string of asterisks with length n
.Quick Solution:
Use the Input Mask plugin to format the input: Input Mask Plugin. This allows you to structure the input to show the first three characters followed by asterisks (e.g., abc***
).
For Data Privacy:
This ensures data remains secure while controlling visibility.
Let me know if you need further assistance setting this up!
About Us:
We’re If-dev, a Bubble agency specializing in app logic and optimization. Reach out for expert help:
support@if-dev.io | LinkedIn | if-dev.io
Your success is our success, and we’d love to collaborate with you to make your vision a reality.