?
Solved

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

Posted on 2011-02-18
2
Medium Priority
?
389 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 40

Accepted Solution

by:
Gurvinder Pal Singh earned 2000 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
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…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Suggested Courses

800 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