Project and Portfolio Management Support and News Forum
Showing results for 
Search instead for 
Do you mean 

Is there a way to prevent a space or special characters from being entered into a text field?

Occasional Contributor

Is there a way to prevent a space or special characters from being entered into a text field?

Hi,

 

I'd like to prevent entry of spaces or special characters into a text field. How would I accomplish this?

 

I looked at the Data Masks in the validations - but I don't seem to find anything that would fit what I need. I would like to allow certain characters like - or _.

 

Thanks,

 

Stephanie

2 REPLIES
Highlighted
Trusted Contributor

Re: Is there a way to prevent a space or special characters from being entered into a text field?

You may be able to write a rule:

- Trigger on a field change for your text field

- look at the string functions available for your database

- Scan the string in the rule

Occasional Contributor

Re: Is there a way to prevent a space or special characters from being entered into a text field?

Thanks for your response. I wasn't able to do this since I could not put the field both in the dependencies and the results in the rule.

 

I think I will try writing a custom javascript function to do the check. Thanks.