<div class="codetitle"> <span><a style="CURSOR: pointer" data="96349" class="copybut" id="copybut96349" onclick="doCopy('code96349')"><u>复制代码</u></a></span> 代码如下:</div> <div class="codebody" id="code96349"> <br>function find_select(name)<br>{<br> var select = document.getElementsByName(name);<br> var find_str = document.getElementById('to_find_str').value;<br> if(select)<br> {<br> select = select[0];<br> var child = select.childNodes;<br> var can=false,text='',len=child.length,is_end=true;<br> for(var i=0;i<len> {<br> if(can)<br> {<br> text = child[i].text;<br> if( text &&<br> text.indexOf(find_str)!=-1)<br> {<br> //console.log(text);<br> child[i].selected = true;<br> var v = child[i].value;<br> select.value = v;<br> select.onchange(v);<br> is_end = false;<br> break;<br> }<br> }<br> if(child[i].selected)<br> can = true;<br> }<br> if(is_end)<br> alert('已没有匹配内容');<br> }<br>}<br></len> </div> <br><div class="codetitle"> <span><a style="CURSOR: pointer" data="88063" class="copybut" id="copybut88063" onclick="doCopy('code88063')"><u>复制代码</u></a></span> 代码如下:</div> <div class="codebody" id="code88063"> <br><tr> <br> <td><?php echo $L_SpecialActivityIdentifier?></td> <br> <td> <br> <select name="Activity[Identifier]" id="Identifier" onchange="change_activity(this.value)"><br> <option value="">请选择</option> <br> <?php <BR> foreach ($ActivityTypes as $Row ) {<br> echo '<option value="'.$Row['Identifier'].'">'.$Row['Name'].'</option>';<br> } <br> ?><br> </select><br> -- <input value="" id="to_find_str" size="16" style="text-align:center;"><input value="find" onclick='find_select("Activity[Identifier]")' type="button"><br> </td> <br> </tr> <br> </div>