View Full Version : How do I?

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?

12-22-2005, 10:29 AM


<title>My home page</title>

<script type="text/javascript">
function printtotextbox(what) {
box = document.yourform.textbox;
box.value=box.value + " " + what;

<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:">

That should work.