?
Solved

asp.net - divide the value of a varaible into 5 textareas...

Posted on 2011-02-22
3
Medium Priority
?
342 Views
Last Modified: 2012-05-11
I have an asp.net page in vb.net....once the data is pulled from a sql connection...
it populates a varable...i need to divide the data in that varaible into 5 textareas...

the first 100 of the chars foes into ta1..the second 100 chars goes into ta2..etc...

the one thing is that the textareas run on the client not at the server...so I am using javascript...
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
3 Comments
 
LVL 10

Author Comment

by:GlobaLevel
ID: 34956588
...am I on the right path here...?

<script language="javascript">
  function OnLoad()
  {
     document.getElementById('Textarea1').value.length <= 100
     document.getElementById('Textarea2').value.length >= 100 and
        document.getElementById('Textarea2').value.length <= 200
     document.getElementById('Textarea3').value.length >= 200 and
        document.getElementById('Textarea3').value.length <= 300
     //...and so on.....
}
</script>
0
 
LVL 82

Accepted Solution

by:
leakim971 earned 2000 total points
ID: 34957299
Check this :


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script language="javascript">
	var fivehundred = "A12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678Z";
	fivehundred += "B12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678Y";
	fivehundred += "C12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678X";
	fivehundred += "D12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678W";
	fivehundred += "E12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678V";
	
	window.onload = function() {
		var five100 = fivehundred;
		var i = 0;
		for(var i=0;i<5;i++) {
			if(five100.length>=100) {
				document.getElementsByTagName("textarea")[i].value = five100.substr(i*100,100);
			}
			else {
				document.getElementsByTagName("textarea")[i].value = five100.substr(i*100);
				break;
			}
		}
	}
	
</script>
</head>
<body>
<textarea cols="100" rows="1"></textarea><br />
<textarea cols="100" rows="1"></textarea><br />
<textarea cols="100" rows="1"></textarea><br />
<textarea cols="100" rows="1"></textarea><br />
<textarea cols="100" rows="1"></textarea><br />
</body>
</html>

Open in new window

0
 
LVL 10

Author Comment

by:GlobaLevel
ID: 34972124
awesome!
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

The Confluence of Individual Knowledge and the Collective Intelligence At this writing (summer 2013) the term API (http://dictionary.reference.com/browse/API?s=t) has made its way into the popular lexicon of the English language.  A few years ago, …
I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

777 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