Hi all, I have this code. I intent to display States in a drop-down box with A selected in drop-down I and related items for A populated in drop-down II.

When i change selection, i want the drop-down II changed. Am testing my javascript with <%String province;%> = myParam; but seems no results. Can i get help on how to assign javascript var returned by function to a java statement.

I dont want to submit for now.

Thanks in advance.

<script language ="javascript">
function displaySelection(){
var myParam = document.statistics.province.value;
<%String province;%> = myParam;
}
.
.
.

//drop-down I
States <select name="States" onchange="displaySelection()">
<option value="1" selected>A</option>
<option value="2">B</option>
<option value="3">C</option>
<option value="4">D</option>
<option value="5">E</option>
<option value="6">F</option>
<option value="7">G</option>
<option value="8">H</option>
</select>

.
.
.
//drop-down II
ObjectX o = new ObjectX();
<% ArrayList<String> s = o.getString(value);
for (int i=0; i<s.size(); i++) {
%>
<br>
Areas
<select name="Towns">
<option <%=s.get(i).getStringName()%></option>
<%}%>
</select>