increase text box length as user types

  • 1 September 2015
  • 1 reply
  • 9 views

Userlevel 3
Badge +9

Can anybody help me with, if there is any property for any smartform text box control where it can expand automtically when it feels out completely and dont show scroll bar.

same as like this Ritch Text control on which I am posting discussoin, it can be draged to expand.


1 reply

Userlevel 5
Badge +16

Hi Ypawar,

 

There is no property to expand textbox automatically but there is workaround:

 

Check this expression:

 

13657i4046A5629EC95B0F.png

 

this is not a 100% optimal, but the closest to what you want to achieve.

 

I should point out that the default width of my text box is 20% = able to contain 30 - 32 capital letters 

 

so in my expression I check if the length of the string in my textbox, if its less than or equals 30, in this case i want to keep the default width with no changes but if the length is more than 30, in this case I multiply the length of the string by 8.5 (approximate pixels per letter) to get the width in pixels.

 

now if your textbox is read only (you read data from SQL or whatever, add Set Controls Properties(drag the expression to the width property) after your list/read method

 

if the user enters value in the textbox, add rule "When Textbox is Changed" then add an action "Set Controls Properties(drag the expression to the width property)"

 

wish this helps :)

Reply