Click here to Skip to main content
16,004,778 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
<asp:DropDownList ID="ddlPD1" DataTextField="vc_pd_far_value" DataValueField="in_pd_far_id"
                    Width="55" runat="server" Enabled="true" onclick="SetDefaultPDValue(this);" />


In this dropdown i want to set its selected index to 60 after 5 second if page loaded..!!
Posted
Updated 13-Feb-13 4:51am
v2
Comments
ZurdoDev 13-Feb-13 10:47am    
use setTimeout in javascript.
k@ran 13-Feb-13 11:22am    
thanks ryanb31 i solved it.

1 solution

XML
<script type='text/javascript'>
    //5000ms (5 seconds) After loading this will fire and select the 60th option
    setTimeout(function(){ document.getElementById("<%= ddlPD1.ClientID %>").options[59].selected = true},5000);
</script>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900