C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...







The string Object



This article explains about JavaScript 'String 'object





<html>

<head>

<script>

function f()

{
v =document.getElementById('txt');

alert(v.value.length);

}


</script>

</head>

<body>

Enter Text and click on button to get lengh:<BR>

<input type ="text" id ="txt">

<input type ="button" value ="Click" onclick ="return f();" >

</body>

</HTML>



The output is self explanatory. It takes the input string and calculates the lengh.

The main purpose of length validation in real time is used in following cases.

  • To check length of password field, minimum as 7 characters maximum 25
  • To check Userid length id the length is not in the specified range and fire validation message
  • To force user to enter in textboxes when it's a mandatory field or any other fields length checking


  • Next Chapter: The Date Object

  • Previous Chapter: The JavaScript String object

  • Tutorial Index



  • dotNet Slackers

    About Us    Contact Us    Privacy Policy    Terms Of Use