复制代码代码如下:
function find_select (имя)
{
var select = document.getElementsbyname (name);
var find_str = document.getElementByid ('to_find_str'). Value;
if (select)
{
выберите = select [0];
var Child = select.ChildNodes;
var can = false, text = '', len = child.length, is_end = true;
для (var i = 0; i <len; i ++)
{
Если (может)
{
Text = Child [i] .Text;
if (text &&
text.indexof (find_str)! =-1)
{
//console.log(text);
ребенок [i]. Selected = true;
var v = ребенок [i] .value;
select.value = v;
select.onchange (v);
is_end = false;
перерыв;
}
}
if (ребенок [i]. Selection)
can = true;
}
if (is_end)
оповещение ('已没有匹配内容');
}
}
复制代码代码如下:
<tr>
<td> <? Php echo $ l_specialactivityIdentifier?> </td>
<Td>
<select name = "Activity [идентификатор]" id = "идентификатор" onchange = "change_activity (this.value)">
<option value = ""> 请选择 </option>
<? php
foreach ($ Activitypes as $ row) {
echo '<option value = ". $ row [' 'Identifier']. . $ Row ['name']. '</Option>';
}
?>
</select>
-<input value = '' id = 'to_find_str' size = 16 style = "text-align: center;" /> <input value = 'find' onclick = 'find_select ("Activity [Identifier]")' type = кнопка />
</td>
</tr>