Skip to main content
1-Visitor
July 31, 2019
Question

How to constrain white space in the text box widget.

  • July 31, 2019
  • 9 replies
  • 2816 views

Hello all,

 

I want to constrain the user to should not enter the space in the text box widget in the run time.

How to achieve this one? 

 

let me know anybody knows the solution.

 

Regards

Sugumar R

9 replies

5-Regular Member
July 31, 2019

The masked Textbox could do the work, but also blocking other symbols as well.

1-Visitor
July 31, 2019

But the masked textbox not allowing me to change the font size of the text.

5-Regular Member
July 31, 2019

Regular Textbox also doesn't provide Font size configuration, right?

18-Opal
July 31, 2019

Hello,

 

What you can do is create a validator, which fires automatically when the user inputs the text. This validator checks the content for whitespace (it's JavaScript, so consider using regular expressions for that), and if the check fails it can display an error status message and block controls to continue, e.g. "Next" or "OK" button.

 

The validator will fire once the textbox loses focus, e.g. the user clicks outside or presses ENTER or TAB. If the user selects some other control on the same mashup (e.g. OK button), the text box will lose its focus first, which still gives you the chance to validate his input.

 

Regards,
Constantine

1-Visitor
July 31, 2019

Hello Constantine,

 

thank you for your work around solution.

but my requirement still differs from this one.

I don't need to trigger the event to execute the validator. the widget itself need to constrain the white space.

 

Regards

Sugumar R

18-Opal
August 1, 2019

Then take a look at "Masked Textbox" widget. In the "Mask" property specify something like "*****", then it will accept 5 alpha-numeric character and no whitespace.