Please help!!

hi, thanks for readinfg this topic.. I facing a problem with the select list box. when i click on the 1st list box , how to make the 2nd list box automatically have the same data?Thanks for your suggestion.!!
[222 byte] By [xiaopang82a] at [2007-9-23]
# 1

Have the JSP talk to a front controller servlet. When you make a selection in the first list box, submit the form to the servlet. Let the servlet put the contents of the second list box into request scope as a list of strings and forward the response back to the original JSP.

You should be using JSTL to keep scriptlet code out of your JSPs, of course.

%

duffymoa at 2007-7-10 > top of java,Enterprise & Remote Computing,Web Tier APIs...
# 2

U can do that using javascript function....

For example , try the following code ::::::

*************************************************************

<script language="javascript">

function fnAssignValue() {

document.myForm.select2.value = document.myForm.select1.value ;

}

</script>

<form name="myForm" >

<select name="select1" onChange="javascript:fnAssignValue();">

<option value="0">0</option>

<option value="1">1</option>

<option value="2">2</option>

<option value="3">3</option>

</select>

<select name="select2" >

<option value="0">no value</option>

</select>

</form>

*************************************************************

Thanks,

Anurag

anurag_dasha at 2007-7-10 > top of java,Enterprise & Remote Computing,Web Tier APIs...