Hi, I am trying to create a form that lets users add 3 schools. They first select select a state then college list will be populated based on the state. States are loaded in prepare method. I'm using struts 2.1.8 and struts-jquery 2.3.1.
<label for="state1">State: </label>
<s:select
id="state1"
name="state1"
list="stateMap"
headerKey="-1"
headerValue="Please Select a State"
onchange="getColleges();"
/><br />
<label for="college1">College 1: </label>
<sj:select
href="loadCollegesByState"
id="college1"
name="college1"
list="collegeList"
listKey="key"
listValue="value"
listenTopics="state1_change"
reloadTopics="state1_change"
headerKey="-1"
headerValue="Please Select a College"
/><br />
javascript
<script type="text/javascript">
function getColleges() {
alert('loading....schools');
$.publish('state1_change');
}
</script>
This works as 2nd is a drop down menu. But I want to make it autocompleter. How can I achieve that? The following doesn't work.
<sj:autocompleter
href="loadCollegesByState"
id="college1"
name="college1"
list="collegeList"
listKey="key"
listValue="value"
listenTopics="state1_change"
reloadTopics="state1_change"
/><br />