HTML Tutorial


 Forum HomeForum Home   FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
RegisterRegister - Not registered yet? Got something to say? Join HTML Code Tutorial!
How can bound the size of textarea with 500 character
Post new topic   Reply to topic    HTML Help Forum Index -> ASP
View previous topic :: View next topic  
Author Message
sanjeev



Joined: 23 Nov 2007
Posts: 31

PostPosted: Fri Nov 23, 2007 1:42 am     How can bound the size of textarea with 500 character Reply with quote

How can bound the size of textarea with 500 character if character are inputed 500 and user input more character then display a message you have no more space now limit it within 500 cahracter. thanks
camoman666



Joined: 24 Jun 2006
Posts: 362
Location: Fort Walton Beach, FL, USA

PostPosted: Fri Nov 23, 2007 5:03 pm     Reply with quote

Code:
<script type="text/JavaScript">
<!--
function check(){
  if(document.form1.text1.value.length < 500){
    alert("Please limit your input to 500 characters.\n\tThank You.");
  }
}
-->
</script>
<form name="form1">
  <textarea name="text1" maxlength=501 onKeyPress=check()></textarea>
</form>


That should work.

Hope this helps.
Display posts from previous:   
Post new topic   Reply to topic    HTML Help Forum Index -> ASP All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
HTML Help Archive
Powered by phpBB © 2001, 2005 phpBB Group
 
HOSTING / DESIGN
MAKE MONEY

Home
  |   Tutorials   |   Forum   |   Quick List   |   About
Copyright ©1997-2002 Idocs and ©2002-2007 HTML Code Tutorial