Javascript Check Textarea Length Of Characters

RegisterLogin
Javascript Check Textarea Length Of Characters
Post Description: if you want to know how you can count the number of charters submitted in a textarea form, this short script will show you how you can. its very simple. the main component here is the field.value.length you can find out how long it is
Tags: javascript, form, textarea, value, length, how much, characters, string, value, type, web, script, code
This Post Was Posted On Aug 02, 2010 By Webune Support #3520
if you want to know how you can count the number of charters submitted in a textarea form, this short script will show you how you can. its very simple. the main component here is the Field.value.length

if you are using windows, open a blank notepad, copy and paste the following code:

<!--
############## CREATED BY WWW.WEBUNE.COM ###############
############## COPYRIGHT UGN/GPL 2010 #################
############# PLEASE DO NOT REMOVE THIS ###############
-->
<p>This small script shows you how to get the javascript value in a web form.<br /></p>

<script type="text/javascript">
function alertselected(){
	var Field = document.getElementById('sample');
 alert('selectedIndex = ' + Field.checked + ' \n value = ' + Field.value + ' \n type = ' + Field.type + ' \n length = ' + Field.value.length );
}
</script>

<form id="someform">
agree to terms: 
<textarea type="checkbox" id="sample"></textarea><br />



<input type="button" onClick="alertselected()" value="alert" />
</form>

<p><img src="http://www.webune.com/images/headers/default_logo.jpg" /></p>
<p>Script Created by www.<a href="http://www.webune.com">Webune.com</a></p>


2. now save the file as form-textarea.html - after you have saved it, open it with your browser and see it action. it will tell you how many character you entered in the textarea field


DEMO

Write whatever you want here:



hope that helps
Download File: form-textarea.html
Leave Your Comments
Related Pages: [Add Your Website]
Post New Topic
danie
#4594 1
it helped me with my send form! thanks a lot
Nov 03, 2010 Reply Report abuse
©2011 Webune Forums - Sun Dec 18, 2011 9:59 pm
Powered by: Webune Forums V3