复制代码代码如下:
función find_select (nombre)
{
var select = document.getElementsByName (nombre);
var find_str = document.getElementById ('to_find_str'). valor;
if (seleccionar)
{
seleccionar = seleccionar [0];
var child = select.childnodes;
var can = false, text = '', len = child.length, is_end = true;
para (var i = 0; i <len; i ++)
{
if (can)
{
texto = niño [i] .Text;
if (texto &&
Text.Indexof (find_str)! =-1)
{
//console.log(Text);
niño [i] .selected = true;
var v = niño [i] .value;
select.Value = V;
select.onchange (v);
is_end = falso;
romper;
}
}
if (niño [i] .selectado)
can = verdadero;
}
if (is_end)
alerta ('已没有匹配内容');
}
}
复制代码代码如下:
<tr>
<TD> <? Php echo $ l_specialActivityIdentifier?> </td>
<TD>
<select name = "Activity [identificador]" id = "identificador" onchange = "change_activity (this.value)">
<opción valor = ""> 请选择 </opción>
<? Php
foreach ($ ActivityTypes AS $ Row) {
echo '<option value = "'. $ row ['identificador']. '"'. ($ row ['identificador'] == $ Activity ['Identifier']? 'Seleccionado': ''). '>' . $ Row ['Nombre']. '</Option>';
}
?>
</select>
-<input value = '' id = 'to_find_str' size = 16 style = "text-align: center;" /> <input value = 'find' onClick = 'find_select ("Activity [Identifier]")' Tipo = botón />
</td>
</tr>