|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
Form validation (not to accept symbols)
Hi, ive been racking my brains for a while now about how to acheive this:
I have a form field where I want a user to enter their name. Unfortunately some users think its funny to enter loads of wierd symbols in their names like joe`¬;bloggs The problem is this nearly always causes an error on the next ASP page when those wierd symbols are tried to be entered in to my database. Could anyone tell me how I could ONLY let the user continue if they have entered alphabetic characters ONLY (no symbols). Many thanks! |
|
#2
|
||||
|
||||
|
|
|
#3
|
|||
|
|||
|
Or another method is you could use this InStr code. If you want to filter out 20 symbols, then you would have to have 20 elseif's, not that efficient, but it works.
Code:
if InStr(trim(Request.Form("Name")),".") = 0 then
' send user back to the previous page
elseif InStr(trim(Request.Form("Name")),";") = 0 then
' send user back to the previous page
elseif InStr(trim(Request.Form("Name")),"~") = 0 then
' send user back to the previous page
:
:
end if
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ASP Programming > Form validation (not to accept symbols) |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|