View Full Version : How do I?
gingerj
12-22-2005, 09:39 AM
I've got two form elements, the first is a select box with some codes say "abc", when you select ABC, it loads the product name into a textbox. How do I do it?
<html>
<head>
<title>My home page</title>
<script type="text/javascript">
function printtotextbox(what) {
box = document.yourform.textbox;
box.value=box.value + " " + what;
}
</script>
</head>
<body>
<form name="yourform">
<input type="checkbox" name="Alpha" value="abc" onclick="printtotextbox('abc')">abc<br>
<input type="checkbox" name="Alpha" value="def" onclick="printtotextbox('def')">def<br>
<input type="checkbox" name="Alpha" value="ghi" onclick="printtotextbox('ghi')">ghi<br>
<input type="text" name="textbox" value="Selected products:">
</body>
</html>
That should work.
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.