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

[Solved] MVC Autocomplete with "Name" attribute gives unexpected behavior

0 Answers 98 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Sydney
Top achievements
Rank 1
Sydney asked on 05 Feb 2011, 03:00 AM
I have the following code:

@Html.Telerik().AutoCompleteFor(model => model.Student.TagString)
    .Name("Tags")

 

    .BindTo(Model.Teacher.Tags)
    .AutoFill(
true)
    .HtmlAttributes(
new { style = "width: 300px" })
    .Filterable(filtering => { filtering.FilterMode(
AutoCompleteFilterMode.StartsWith); })
    .Multiple(multi => { multi.Separator(
", ").Enabled(true); })

If I have the following "tags" (one, two, three), the user should be able to type "one" followed by a comma to indicate that she is starting a new entry.  However, I am forced to manually select "one" from the drop-down to get the comma, and then I have to click back into the text box to type another value.

The odd thing is that the sample on your site does not behave that way.  But I think I have selected the same options.

Ah!  It just started working when I removed the Name attribute - posting this for posterity, in case you want to replicate. 

 

Tags
General Discussions
Asked by
Sydney
Top achievements
Rank 1
Share this question
or