Solved

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

Posted on 2011-02-18
2
382 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

708 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

15 Experts available now in Live!

Get 1:1 Help Now