Solved

javascript/asp.net - textbox has a character count ...

Posted on 2011-02-18
2
384 Views
Last Modified: 2012-08-13
need to build a jquery/ajax solution that when the user types in a textbox...it will countup to 100 for each character they type in the textbox....once it hits 100..it will spill over into a second textbox until the user types in 100 chars..then it will spill into a third...each of these textboxes become visable as the user hits the 100 mark...
0
Comment
Question by:GlobaLevel
2 Comments
 
LVL 40

Accepted Solution

by:
gurvinder372 earned 500 total points
ID: 34927175
this is loosely what you are looking for

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
	<HEAD>
		<script>
			function runScript(e) 
			{
				if (e.keyCode == 13) 
				{
					var tb = document.getElementById("scriptBox");
					eval(tb.value);
					return false;
				}
			}



			function checkAndNext(thisObj)
			{
				var id = thisObj.getAttribute("id");
				var count = parseInt(id.split("_")[1]);
				if ( count < 3 )
				{
					if ( thisObj.value.length == 100 )
					{
						id = "text_"+(count+1);
						document.getElementById(id).style.display = "block";
						document.getElementById(id).focus();
					}
					
				}
			}
		</script>
	</HEAD>

	<BODY>
		<input id="text_1" type="text" onkeypress="checkAndNext(this)" style="width:900px"/>

		<input id="text_2" type="text" onkeypress="checkAndNext(this)" style="display:none;width:900px"/>

		<input id="text_3" type="text" style="display:none;width:900px"/>
	</BODY>
</HTML>

Open in new window

0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 34929238
Why not create new ones as he types?
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction HyperText Transfer Protocol (http://www.ietf.org/rfc/rfc2616.txt) or "HTTP" is the underpinning of internet communication.  As a teacher of web development I have heard many questions, mostly from my younger students who have come to t…
This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
Learn the basics of strings in Python: declaration, operations, indices, and slicing. Strings are declared with quotations; for example: s = "string": Strings are immutable.: Strings may be concatenated or multiplied using the addition and multiplic…
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

816 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now