?
Solved

simple javascript mod

Posted on 2005-03-24
2
Medium Priority
?
274 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
[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
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

Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

Question has a verified solution.

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

Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
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