<SCRIPT LANGUAGE="JavaScript">
<!-- Original: Anand Raman (anand_raman@poboxes.com) -->
<!-- Web Site: http://www.angelfire.com/ar/diduknow -->
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->
<!-- Begin
function SelObj(formname,selname,textname,str) {
this.formname = formname;
this.selname = selname;
this.textname = textname;
this.select_str = str || '';
this
.selectArr
= new Array();this.initialize = initialize;
this.bldInitial = bldInitial;
this.bldUpdate = bldUpdate;
}
function initialize() {
if (this.select_str =='') {
for(var i=0;i<document.forms[this.formname][this.selname].options.length;i++) {
this.selectArr[i] = document.forms[this.formname][this.selname].options[i];
this.select_str += document.forms[this.formname][this.selname].options[i].value+":"+
document.forms[this.formname][this.selname].options[i].text+",";
}
}
else {
var tempArr
= this
.select_str
.split(','); for(var i=0;i<tempArr.length;i++) {
var prop
= tempArr
[i
].split(':'); this.selectArr[i] = new Option(prop[1],prop[0]);
}
}
return;
}
function bldInitial() {
this.initialize();
for(var i=0;i<this.selectArr.length;i++)
document.forms[this.formname][this.selname].options[i] = this.selectArr[i];
document.forms[this.formname][this.selname].options.length = this.selectArr.length;
return;
}
function bldUpdate() {
var str = document.forms[this.formname][this.textname].value.replace('^\\s*','');
if(str == '') {this.bldInitial();return;}
this.initialize();
var j = 0;
pattern1 = new RegExp("^"+str,"i");
for(var i=0;i<this.selectArr.length;i++)
if(pattern1.test(this.selectArr[i].text))
document.forms[this.formname][this.selname].options[j++] = this.selectArr[i];
document.forms[this.formname][this.selname].options.length = j;
if(j==1){
document.forms[this.formname][this.selname].options[0].selected = true;
//document.forms[this.formname][this.textname].value = document.forms[this.formname][this.selname].options[0].text;
}
}
function setUp() {
obj1 = new SelObj('nieuw_bericht','ontvanger','ontvanger_box');
// menuform is the name of the form you use
// itemlist is the name of the select pulldown menu you use
// entry is the name of text box you use for typing in
obj1.bldInitial();
}
// End -->
</script>
<script language="javascript" type="text/javascript">
setUp();
</script>
<form name="nieuw_bericht">
<table style="width: 50%;">
<tr style="background-color: #DEE2E7">
<td width="25%"> » Ontvanger:</td>
<td width="75%">
<font face="arial, helvetica" size="-1">Please enter the first few letters of the item you are looking for.</font>
<br><br>
<input type="text" name="ontvanger_box" size="30" onKeyUp="javascript:obj1.bldUpdate();">
<select name="ontvanger">
<option value="">-Selecteer de ontvanger-</option>
<option value="203" style="color: #0000CC">AAAA</option>
<option value="3">lid0</option>
<option value="103">lid0</option>
<option value="4">lid1</option>
<option value="104">lid1</option>
<option value="13">lid10</option>
<option value="113">lid10</option>
<option value="57">lid54</option>
</select> </td>
</tr>
</table>
<input type="submit" name="Submit" value="Verzenden" />
</form>