Re: Is there a way to prevent a space or special characters from being entered into a text field? (153 Views)
Reply
Occasional Contributor
ssirwin
Posts: 6
Registered: ‎06-28-2012
Message 1 of 3 (179 Views)

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

Trusted Contributor
kwood55
Posts: 131
Registered: ‎04-09-2012
Message 2 of 3 (153 Views)

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
ssirwin
Posts: 6
Registered: ‎06-28-2012
Message 3 of 3 (126 Views)

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.

The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.