Controlling what gets typed into a Key field

public static string RemoveSpecialCharacters(string str)
{

return Regex.Replace(str, "[^a-zA-Z0-9_.]+", "",
RegexOptions.Compiled).ToUpper();
}


*Jose C Gomez*
*Software Engineer*
*
*T: 904.469.1524 mobile
E: jose@...
http://www.josecgomez.com
<http://www.linkedin.com/in/josecgomez> <http://www.facebook.com/josegomez>
<http://www.google.com/profiles/jose.gomez> <http://www.twitter.com/joc85>
<http://www.josecgomez.com> <http://www.josecgomez.com/feed/>

*Quis custodiet ipsos custodes?*



On Fri, Dec 3, 2010 at 12:09 PM, Joe Rojas <jrojas@...> wrote:

>
>
> Hello,
>
> One of the things that I've always battled with is trying to get users
> to remember our data entry rules when creating new items.
>
> The main field that causes heartburn is the Key field.
>
> My standard rule has always been: No special characters, no spaces, and
> just cap letters and numbers.
>
> I've always wanted to create a standard code snippet for either a
> customization or BPM that I could fairly easily apply where ever I
> needed it.
>
> Before I start that task, has anyone else created something like this?
> If so, would you mind sharing your code snippet?
>
> Thanks!
>
>
>
>
>
>
>
> Joe Rojas | Director of Information Technology | Mats Inc
> dir: 781-573-0291 | cell: 781-408-9278 | fax: 781-232-5191
> jrojas@... <jrojas%40matsinc.com> | www.matsinc.com Ask us about
> our clean, green and beautiful matting and flooring
>
> This message is intended only for the individual named. If you are not the
> named addressee you should not disseminate, distribute or copy this e-mail.
> Please notify the sender immediately by e-mail if you have received this
> e-mail by mistake. Please note that any views or opinions presented in this
> email are solely those of the author and do not necessarily represent those
> of the company.
>
> [Non-text portions of this message have been removed]
>
>
>


[Non-text portions of this message have been removed]
Hello,



One of the things that I've always battled with is trying to get users
to remember our data entry rules when creating new items.

The main field that causes heartburn is the Key field.

My standard rule has always been: No special characters, no spaces, and
just cap letters and numbers.



I've always wanted to create a standard code snippet for either a
customization or BPM that I could fairly easily apply where ever I
needed it.

Before I start that task, has anyone else created something like this?
If so, would you mind sharing your code snippet?



Thanks!










Joe Rojas | Director of Information Technology | Mats Inc
dir: 781-573-0291 | cell: 781-408-9278 | fax: 781-232-5191
jrojas@... | www.matsinc.com Ask us about our clean, green and beautiful matting and flooring


This message is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake. Please note that any views or opinions presented in this email are solely those of the author and do not necessarily represent those of the company.


[Non-text portions of this message have been removed]