Skip to main content
Jul 31, 2019 4:57 AM UTC
Question

How to constrain white space in the text box widget.

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

Jul 31, 2019 6:08 AM UTC

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

Jul 31, 2019 8:49 AM UTC

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

Jul 31, 2019 8:53 AM UTC

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

Jul 31, 2019 10:02 AM UTC

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

Jul 31, 2019 12:21 PM UTC

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

Aug 1, 2019 7:59 AM UTC

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.