I am using a select function with a 2 level filter, and i can copy the result and have it display in another box using a script, however i dont want the value in the option value field i want the actual text displayed which in my case has to be different
<select name="selectbranch" id="selectbranch">
<option selected="selected" value="">-Select-</option>
<option value="1">Basildon</option>
</select>
<select name="branch" id="branch">
<option selected="selected" value="">-Select-</option>
<option value="Basildon">staff1</option>
</select>
<input type="text" id="branchstaff" name="branchstaff" placeholder="branchstaff" />
<script>
function sync() {
var sel = document.getElementById("branch");
var text = sel.options[sel.selectedIndex].text;
}
</script>
however the result is Basildon but i want the result to be staff1