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

Bug Selection\Validation

11 Answers 235 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
sitefinitysteve asked on 01 May 2012, 09:53 PM
Steps:
  1. Initialize the combo (assuming it's already populated in the markup as a select->option with text and values)
    $("#combo").kendoComboBox({
            filter: "contains"
        });
  2. Add a couple of characters to the end of the first item, thereby making it "technically" invalid as it's not an item in the combo
  3. Click your button to validate
  4. Passes
  5. Pick a new item from the combo
  6. Add a couple characters to the end
  7. Click button again
  8. Fails validation

11 Answers, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 03 May 2012, 05:07 PM
Hello Steve,

 
I am not sure that I was able to understand where the issue exactly is. Could you please provide a test project which replicates the problem?

Greetings,
Georgi Krustev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
answered on 03 May 2012, 05:44 PM
 Shouldn't need a project :)

The problem is that once I change the text on the first combo item, it should invalidate that item...because it's not a valid selection anymore.  This is how it works when you select another item in the list, but on load the first item always passes validation.
0
Georgi Krustev
Telerik team
answered on 08 May 2012, 12:34 PM
Hello Steve, 

The ComboBox widget does not have any built-in validation functionality. Could you please provide a code snippet which shows the current implementation? Thus I will be able to observe it locallly and advice you further.
 

Greetings,
Georgi Krustev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
answered on 08 May 2012, 01:32 PM
Right, but wire some up to it :) 

Video: http://screencast.com/t/Vz2ilH3kNUDG
Fiddle: http://www.screencast.com/t/YA0pfvmZp

With "contains" the moment I change the text and there's no item in the combo that matches, it should fail validation.
0
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
answered on 10 May 2012, 01:23 PM
What do you think?...
0
Georgi Krustev
Telerik team
answered on 11 May 2012, 02:46 PM
Hello Steve,

 
Thank you for the screencasts. I believe that this behavior is expected and I cannot confirm it as a bug. The "required" attribute of the select element, means that the validation will pass if there is any value. As you probably know, the combobox widget allows custom value. Hence when you type "Item" the value of the combobox is "Item" and the validation passes. You can prevent custom value wiring the change event and clearing the combobox's value using value method. Check this link for more information.

All the best,
Georgi Krustev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
answered on 11 May 2012, 02:53 PM
Hmmm...I see what you mean...but hear me out on why I'd like this classified AS a bug :)

When I have a combobox I want to give the users a set of values to pick from, I don't expect\want it to be a freeform text input.  If I wanted that, I would have used the AutoComplete instead.

So when I enable filter: "contains" what I would expect would happen is that it allows the user to filter the list, while still maintaining list integrity, not become a freeform text input....since what they type has no value. 

Know what I mean?
0
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
answered on 16 May 2012, 01:32 PM
Would you at least perhaps consider wrapping your couple lines of code there into a configuration property "allowCustomText" or something?...so we don't have to keep re-implementing this every time?

The logic almost already exists with the placeholder config element
0
Accepted
Georgi Krustev
Telerik team
answered on 16 May 2012, 03:15 PM
Hello Steve,

 
The ComboBox widget is desined to allow entering a custom value. Setting the filter option specifies the filtering functionality of the DataSource and does not prevent entering of the custom value. I will suggest you use a DropDownList widget, which does not allow custom values.

I will log you request to our internal system for further consideration.

Regards,
Georgi Krustev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
answered on 16 May 2012, 03:47 PM
Problem with a dropdown though is you can't filter out results...we're talking a combo bound to 250 things right :)...lots to scroll though

Please consider the feature request, and I'll use your logic to check for a custom value in the meantime

Thanks Georgi
0
Vesselin Obreshkov
Top achievements
Rank 2
answered on 11 Sep 2012, 01:29 AM
I believe your request is similar the this UserVoice item: http://feedback.kendoui.com/forums/127393-kendo-ui-feedback/suggestions/2295877-enhance-combobox-autocomplete. Go vote and hopefully they'll enhance those controls soon.



We too wish the ComboBox could filter only through it's available values and have option to not allow custom values since 99% of the time when people need control like this, they really want a dropdown list that has a quick search/autocomplete of the possible values. In our app, the only place where we need a combobox the way it currently works is in one location - to allow people to either enter their own password/security question or select from pre-defined ones. Every time I put a combobox anywhere I need to explain to people how it works and why it lets them enter "crap that's not there".



Tags
ComboBox
Asked by
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
Answers by
Georgi Krustev
Telerik team
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
Vesselin Obreshkov
Top achievements
Rank 2
Share this question
or