C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




regular expression


Posted Date: 20 Sep 2006      Total Responses: 6

Posted By: mahenderrao       Member Level: Bronze     Points: 2


i want add regular expression for my username in login form and it does not accept special char and space? try to send this code as quick as possible



Responses

Author: Jakkaraju Sivakumar Sandeep kumar     20 Sep 2006Member Level: SilverRating:     Points: 2
which special chars u want avoid be clear ...


Author: Mohan Kumar    20 Sep 2006Member Level: DiamondRating:     Points: 2
hi,

go through links.

http://aspnet.4guysfromrolla.com/articles/022603-1.aspx
www.devarticles.com/c/a/VB.Net/Regular-Expressions-in-.NET

-Mohan kumar


Author: Mohan Kumar    20 Sep 2006Member Level: DiamondRating:     Points: 2
hi,

go through links.

http://aspnet.4guysfromrolla.com/articles/022603-1.aspx
www.devarticles.com/c/a/VB.Net/Regular-Expressions-in-.NET

-Mohan kumar


Author: Padma    20 Sep 2006Member Level: DiamondRating:     Points: 2
Try with Javascript

function isAlphaKey(evt)
{
var charCode = (evt.which) ? evt.which : event.keyCode
if (charCode > 31 && (charCode < 65 || charCode > 90) && (charCode < 97 || charCode > 122))
return false;

return true;

}


Author: Padma    20 Sep 2006Member Level: DiamondRating:     Points: 2
Try with javascript
function isAlphaKey(evt)
{

var charCode = (evt.which) ? evt.which : event.keyCode
if (charCode > 31 && (charCode < 65 || charCode > 90) && (charCode < 97 || charCode > 122))
return false;

return true;

}


Author: Alla.Harini    20 Sep 2006Member Level: SilverRating:     Points: 2
<script language="javascript">

function validate()
{

var iChars = "!@#$%^&*()+=-[]\\\';,./{}|\":<>?"+" ";//" " used to avoid space

for (var i = 0; i < document.formname.fieldname.value.length; i++)
{
if (iChars.indexOf(document.formname.fieldname.value.charAt(i)) != -1)
{
alert ("Your username has special characters. \nThese are not allowed.\n Please remove them and try again.");
return false;
}
else
{
return true;
}

}


}

</script>

U just place what ever characters u want to avoid in "iChars" field

Regards,
Harini





Post Reply
You must Sign In to post a response.
Next : how to add a combobox in a datagrid in VB .NET
Previous : dropdownlist
Return to Discussion Forum
Post New Message
Category: .NET

Related Messages



dotNet Slackers   BizTalk Adaptors    Web Design

doors in nj

Contact Us    Privacy Policy    Terms Of Use