Textbox starts with something

i want to show my user while they were start typing on text it must contation two numbers before(automatically)

You can do that by using text changed block or also you can join whatever you want to the text box text by using join text block.

can share the block image

here it is

if I did’t misunderstand the question “what you want to do is show two numbers in the text box before the user enters text” to do that you can use this component to show text at the beginning of the text box
https://docs.kodular.io/components/user-interface/text-box/#text

blocks (2)
it not working
i want the +91 as comings before the number

but now it come like this


i cant able to write

if you use on text change you enter in loop !!!

1 Like

This is exactly what you want. If country code is fixed then just show it in a label and Add country code from block.

When user go to next then just use join block with +91 and text box text.

IMG_20200907_182143

3 Likes

You can use lost Focus to join +91 and number , it will add +91 when the text box have lost the focus you can also use if else to ensure that number text box is not empty

Try this :point_up_2:t4:

Or can you try default Text box.text to what you want in designer side.

Something like this :point_down: (do watch 1st TextBox)




can be achieved with this :point_down:




Explaination of the video and code as well

  1. When the first text box gets focus, it will automatically add +91, and then user can continue typing the further number.

  2. If by any chance user deletes the entire number, and enter a new number without adding +91, then the same will be automatically added by the program. Also note that if user himself/herself, adds +91 while typing the number, then the program will not add +91 on its own

Hope this helps :+1:
:slightly_smiling_face:

6 Likes

ok,
got it thanks you

1 Like

Its a simple procedure block that can be dragged in block section from Procedures --> the first block. And then I just renamed it to addCode

Edit: Its look like you edited the part in your above reply where you asked about the procedure block.

1 Like

I think this is the most simple, straightforward and best way to achieve your query

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.