buckbeak
09-13-2002, 05:03 AM
I have a list of parts with checkbox beside them. So when user click on the checkbox, the value of the checkbox will pass to a another textbox.
The problem is there are multiple checkbox. Here are my codes:-
I'm only able to pass only one value.
<script language="javascript">
<!--
var frm = document.list;
function Update(fld){
document.list.post_here.value = fld;
</script>
<input type="checkbox" name="check_stk" value="part1" onClick="javascript:Update(this.value)">Part 1
:
Part 2 and so on.......
<input type="text" name="post_here" value="">
If more then one check box is selected, the value on textbox post_here suppose to be part1, part2,part3, etc......
I thought of putting it in array, but i dunno how to loop an array!
Please help!
The problem is there are multiple checkbox. Here are my codes:-
I'm only able to pass only one value.
<script language="javascript">
<!--
var frm = document.list;
function Update(fld){
document.list.post_here.value = fld;
</script>
<input type="checkbox" name="check_stk" value="part1" onClick="javascript:Update(this.value)">Part 1
:
Part 2 and so on.......
<input type="text" name="post_here" value="">
If more then one check box is selected, the value on textbox post_here suppose to be part1, part2,part3, etc......
I thought of putting it in array, but i dunno how to loop an array!
Please help!