Restrict special characters
- From: Hima <Hima@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 11 Dec 2008 10:56:01 -0800
How do i restrict users from inserting special characters in a text box.
Right now I am restricting the users from entering a single quote ' in the
text box.
I check for these sepecial characters when they hit the save button on the
screen.
Currently I use the following code:
' Name should not contain a single quote.
If InStr(Trim(txtName.Text), "'") <> 0 Then
editTransaction = blnAllowExit
showMsg("Name Should not contain a single quote.Please correct
before
saving", MsgBoxStyle.Critical, strTitle)
txtName.Focus()
Exit Function
End If
How do I restrict the rest of the special characters except for - and _.
Please help...
Thanks a lot.
Hima..
.
- Follow-Ups:
- Re: Restrict special characters
- From: dwm
- Re: Restrict special characters
- From: expvb
- Re: Restrict special characters
- From: Ralph
- Re: Restrict special characters
- Prev by Date: Re: Form is Loaded
- Next by Date: Re: Restrict special characters
- Previous by thread: Re: Form is Loaded
- Next by thread: Re: Restrict special characters
- Index(es):