开发者

default selection with ajax request jquery

Hi I've made a ajax request selection tool in the right column.

http://www.lensfinder.se/testar5.开发者_JS百科php

How do I make a selection the default one? Because when you enter the page I want one to be open, now it hasen't made any request u


Some simple javascript....

<script language="javascript"><!--
     document.getElementById('lins').value='Endagslins';
//--></script>

If you put this code somewhere after the select box, it should change the select box's value and trigger the getlenslist() function once the page is loaded. If you have any problems, you might need to attach this to the page's onload event.

alternatively, you can flag the select item you want selected like this:

<option value="Endagslins" selected>Endagslins</select>

This way, when the page loads, you will already have selected the correct item and you should only need to do

onload="getlenslist();"
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜