Click here to Skip to main content
15,920,438 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
I hava a dropdownList with selected index changed event...Now it's working fine..
I set my dropdownlist in UPdate Panel control...Now my Problem is

" If i select an item from dropdownlist then cursor is gone..
but i want to select an item from They key board..using java script or jquery


please help me
Posted
Updated 13-Jun-14 23:40pm
v4
Comments
Sergey Alexandrovich Kryukov 15-Jun-14 19:12pm    
There is no such thing as "java script". Java is not a scripting language.
—SA

1 solution

set focus() using javascript after event fired like this
JavaScript
document.getElementById("ControlID").focus();
 
Share this answer
 
Comments
[no name] 14-Jun-14 5:56am    
where i write this line..and javascript function() where i used
Nirav Prabtani 14-Jun-14 6:16am    
Can you post your code?? so i can exactly tell you.
[no name] 14-Jun-14 6:17am    
<td>
<asp:DropDownList ID="DDLTrader" runat="server" AutoPostBack="true" OnSelectedIndexChanged="DDLTrader_SelectedIndexChanged"
TabIndex="2">

</td>
[no name] 14-Jun-14 6:18am    
protected void DDLTrader_SelectedIndexChanged(object sender, EventArgs e)
{
try
{
if (DDLTrader.SelectedItem.Text == "Fresh")
{
pnl1.Visible = true;
GetBranch();
}
else
{
pnl1.Visible = false;
}
}
catch (Exception ex)
{
Log(ex.Message, ex.StackTrace);
ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "Exception Message", "alert('You have an exception')", true);

}
}
Nirav Prabtani 14-Jun-14 6:35am    
protected void DDLTrader_SelectedIndexChanged(object sender, EventArgs e)
{
try
{
if (DDLTrader.SelectedItem.Text == "Fresh")
{
pnl1.Visible = true;
GetBranch();
ddl.Focus();
}
else
{
pnl1.Visible = false;
}
}
catch (Exception ex)
{
Log(ex.Message, ex.StackTrace);
ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "Exception Message", "alert('You have an exception')", true);

}
}

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