This is a migrated thread and some comments may be shown as answers.

RadAutoCompleteBox needs to trigger ASP button.

1 Answer 75 Views
AutoCompleteBox
This is a migrated thread and some comments may be shown as answers.
John
Top achievements
Rank 1
John asked on 22 Oct 2012, 09:02 AM
I have the RadAutoCompleteBox on my page and next to it is a an ASP button.

<asp:Button ID="LoadReportButton" runat="server" Text="Load Report" OnClick="LoadReportButton_Click" />


Is there any way when a user selects a value on the drop down and creates a token all they have to do is press enter on the keyboard instead of pressing tab then enter.

I have it so far when you select an item it fires the function, entry added and displays a pop up saying what you have selected.
<script type="text/javascript">
    function entryAdded(sender, eventArgs)
    {
        alert("An item with Text='" + eventArgs.get_entry().get_text() + "' has just been selected.");
    }

I just need a piece of code that highlights the button or even fires the button automatically which would be cool.

Cheers

John Moore

1 Answer, 1 is accepted

Sort by
0
Kalina
Telerik team
answered on 23 Oct 2012, 04:14 PM
Hi John,

I am afraid that the scenario that you want to implement is not supported.

You can optionally try to focus the button in this way:
function OnClientEntryAdded(sender, eventArgs) {
        var button = document.getElementById("<%=btnSubmit.ClientID %>").focus();
}
<telerik:RadAutoCompleteBox runat="server" OnClientEntryAdded="OnClientEntryAdded"
    ID="RadAutoComplete1" DataSourceID="SqlDataSource1"
    DataTextField="CategoryName" DataValueField="CategoryID">
</telerik:RadAutoCompleteBox>
<asp:Button ID="btnSubmit" runat="server" Text="Submit" />

All the best,
Kalina
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
AutoCompleteBox
Asked by
John
Top achievements
Rank 1
Answers by
Kalina
Telerik team
Share this question
or