复制代码代码如下:
fonction find_select (nom)
{
var select = document.getElementsByName (name);
var find_str = document.getElementByid ('to_find_str'). valeur;
si (sélectionnez)
{
select = select [0];
var child = select.childNodes;
var can = false, text = '', len = child.length, is_end = true;
pour (var i = 0; i <len; i ++)
{
si (peut)
{
text = enfant [i] .Text;
if (text &&
text.indexof (find_str)! = - 1)
{
//console.log(xt);
Enfant [i] .Selected = true;
var v = enfant [i] .value;
select.value = v;
select.onchange (v);
is_end = false;
casser;
}
}
if (enfant [i] .Section)
can = true;
}
if (is_end)
alerte ('已没有匹配内容');
}
}
复制代码代码如下:
<tr>
<Td> <? Php echo $ l_specialactivityIdentifier?> </td>
<TD>
<select name = "Activity [identificateur]" id = "identificateur" onchange = "change_activity (this.value)">
<Option Value = ""> 请选择 </ Option>
<? Php
ForEach ($ ActivityTypes comme $ row) {
echo '<option value = "'. $ row ['identifier']. '' ''. ($ row ['identifier'] == $ activité ['identificateur']? 'Selected': ''). '>' . $ Row ['name']. '</ Option>';
}
?>
</lect>
- <input value = '' id = 'to_find_str' size = 16 style = "text-align: Center;" /> <input value = 'find' onclick = 'find_select ("Activité [identifiant]")' type = bouton />
</td>
</tr>