Click here to Skip to main content
15,904,415 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
Sir,i want code for following
textbox should not accept more than one space using validation control
Posted
Comments
Sandeep Mewara 8-Aug-12 11:53am    
It does not work like this here.

Here is what is expected of enquirers:
1. TRY first what you want to do! You may find that it's not that hard.
2. Formulate what was done by you that looks like an issue/not working.

Try them and tell if you face issues.
Members will be more than happy to help like this.

1 solution

Use this jaavascript regular expression:
JavaScript
var isvalid= /^\s?(\S+\s?)+$/.test(textarea.value);





--Amit
 
Share this answer
 
Comments
herooooo 8-Aug-12 6:06am    
Sir,
how to apply ths code..can u help?
_Amy 8-Aug-12 6:10am    
On blur event of the textbox check the regular expression.
Take the help of these link :
http://www.roseindia.net/javascript/form-validation-regular-expressions.shtml[^]
or
http://www.javascriptkit.com/javatutors/re.shtml[^]
herooooo 8-Aug-12 6:25am    
gettin confuse sir...not gettin :(...
AmitGajjar 8-Aug-12 6:29am    
Actually you are asking incorrect question. you need to study first then you can ask for any solution. read books and then try some work.
herooooo 8-Aug-12 6:33am    
This iS smthin new task fr me so finding it diffclt nothin else

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900