Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2011-02-18
2
Medium Priority
?
390 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article will show, step by step, how to integrate R code into a R Sweave document
A while back, I ran into a situation where I was trying to use the calculated columns feature in SharePoint 2013 to do some simple math using values in two lists. Between certain data types not being accessible, and also with trying to make a one to…
The viewer will learn how to count occurrences of each item in an array.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

636 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