Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

simple javascript mod

Posted on 2005-03-24
2
Medium Priority
?
275 Views
Last Modified: 2008-03-17
hi i have the following:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">

<html>

<head>
<title></title>
<script language="JavaScript" type="text/javascript">
<!--

function tb(obj,mess){
document.getElementById(obj).value=mess;
}

//-->
</script>

</head>

<body>
<span onclick="javascript:tb('TB1','Text One ');" >Link One</span><br>
<span onclick="javascript:tb('TB1','Text Two ');" >Link Two</span><br>
<span onclick="javascript:tb('TB1','Text Three ');" >Link Three</span><br>
<input id="TB1" size="10">
</body>

</html>

which works fine and puts Text One Text Two or Text Three in the textbox but i need to have multipul selections co if i click on Link One then Link Two the textbox reads "Text One Text Two " a reset button would be handy to
i dont know mutch about javascript so any help is gratly apreshated
thanks
0
Comment
Question by:kingpin200004
  • 2
2 Comments
 
LVL 25

Expert Comment

by:archrajan
ID: 13625242
TRY

function tb(obj,mess){
document.getElementById(obj).value += mess;
}
0
 
LVL 25

Accepted Solution

by:
archrajan earned 340 total points
ID: 13625254
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">

<html>

<head>
<title></title>
<script language="JavaScript" type="text/javascript">
<!--

function tb(obj,mess){
document.getElementById(obj).value += mess;
}

//-->
</script>

</head>

<body>
<span onclick="javascript:tb('TB1','Text One ');" >Link One</span><br>
<span onclick="javascript:tb('TB1','Text Two ');" >Link Two</span><br>
<span onclick="javascript:tb('TB1','Text Three ');" >Link Three</span><br>
<input id="TB1" size="10">
<input type = 'button' value = "RESET" onclick = "document.getElementById('TB1').value = ''">
</body>

</html>
0

Featured Post

[Webinar On Demand] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

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 …
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
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

580 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