Buy Questpond's video subscriptions on
huge discount
.
Online: 3845
Home
Articles
Interviews
Forums
For Beginners
Popular Questions
ITIL Career Advice
PMP Career Advice
Career Advices
Codes
Videos
ASP.NET
ASP.NET MVC
Android Intel XDK
Sql Server
AngularJS
Bootstrap
Backbone.JS
MongoDB
LESS (CSS)
jQuery
WPF
WWF
SSIS
LightSwitch
Tutorials
News
ASP.NET MVC
|
Be Interview Ready
|
Top Performers
|
DNF MVP
|
Top Posts
|
Winners
|
Subscribe
|
Catalogs
Welcome Guest !
Register
Login
Home
>
Forums
>
JavaScript
>
Loading ...
How do you validate textbox value using javascript
Posted by
Bravi
under
JavaScript
on 9/25/2009 | Views : 5872 | Status :
[Member]
| Replies : 2
Write New Post
|
Search Forums
|
Resolved Posts
|
Un Answered Posts
|
Forums Home
How do you validate textbox value whether it is number or string using javascript
Reply
|
Reply with Attachment
Alert Moderator
Responses
Posted by:
Raja
on: 9/25/2009
[Member]
Starter
0
You can get idea from below posts
http://www.dotnetfunda.com/codes/code158-how-to-validate-a-value-against-a-regular-expression-in-client-side-j.aspx
For JavaScript regular expression, see this link
http://www.rgagnon.com/jsdetails/js-0063.html
Thanks
Regards,
Raja, USA
Bravi
, if this helps please
login
to
Mark As Answer
. |
Alert Moderator
Posted by:
Rtpharry
on: 9/28/2009
[Member]
[MVP]
Bronze
0
Hey,
I would recommend sticking to development best practices and use the asp.net validation framework.
You can use a regular expression to do the actual validation. There are lots of regex's available at this site:
http://www.regexlib.com/
You can plug this in to a RegularExpressionValidator which includes support out of the box for client side (javascript) and server side validation.
http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.regularexpressionvalidator.aspx
Remember - if you only validate on the client side then you are leaving a hole in your application. A user could have javascript turned off and then bad data could be passed in to your database. By checking on the client side first you get a nice user experience and then checking on the server side after you get security.
As for your specific validation request you have to be very clear so that we can help you build a working regex to meet your needs. Are you saying you want to allow any amount of letters and numbers but no other characters? Please give some examples of valid inputs and some examples of inputs you would like to block.
Bravi
, if this helps please
login
to
Mark As Answer
. |
Alert Moderator
Login to post response
Latest Posts
How to get the exact property name while getting error
(0)
PDB file is not showing Line Number in dot net application hosted on server
(0)
Both Strings morethan 5 letters in length end of the words one vowel and one consonent is different
(0)
how to check Any adjacent letters transposed between two strings(ex: JOHN, JHON)
(1)
can't receive data after success login ?
(1)
Implement Multi-Tenant in Azure Logic Apps
(0)
Why ASP.Net Core 7.0 Web API showing as Connection refused?
(0)
Iterating over columns of dataframe and print as rows in Python Django
(0)
More ...