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

Remove default Validation for Autocomplete

4 Answers 191 Views
AutoComplete
This is a migrated thread and some comments may be shown as answers.
Karthick
Top achievements
Rank 1
Karthick asked on 24 Feb 2017, 06:47 AM

Hi All , 

 

I want to remove the default validation given by the kendo ui for Autocomplete.Please help me in achieving this.

4 Answers, 1 is accepted

Sort by
0
Ivan Danchev
Telerik team
answered on 24 Feb 2017, 09:31 AM
Hello Karthick,

Could you elaborate more or demonstrate (in a dojo example for instance) what you mean by "default validation" for the AutoComplete and how do you trigger the widget's validation in your specific scenario?

Regards,
Ivan Danchev
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Karthick
Top achievements
Rank 1
answered on 24 Feb 2017, 10:03 AM

Thank you for your kind reply, 

 

I am using kendo inline grid, and this is my column on which i have an autocomplete editor for it. even i have set required to false in model field declaration also. but when i am creating a new record and trying to save the record leaving poslip(autocomplete field ) as null , it is getting validated. guess this is a default validation for some editors in kendo like dropdownlist will validate by default when not selected. Here I dont need this validation. kindly guide me how to remove this validation.

 

---------------- // model field declaration  --------------

poslip : { type: "string",validation: { required: false}} 

------------------// column declaration----------------------

{
            ffield: "poslip",
            title: "PO  Slip",
            filterable: false,                 
            editor:AutoCompleteEditor,                    
            autowidth:true }


-------------- editor function-------------------------

function AutoCompleteEditor(container, options) {

 var dataSource = new kendo.data.DataSource({
transport: {
read: crudServiceBaseUrl +"getPOSlipNumbers/"+cn+"/"+on+"/"+ot+"/"+sn      
},
});
$('<input required="required" name="' + options.field + '"/>')

.appendTo(container)
.kendoAutoComplete({
dataTextField: "poslip",
filter: "startswith",
minLength: 2,
dataSource:dataSource,
placeholder: "Select POSlip"
});
}
}

0
Karthick
Top achievements
Rank 1
answered on 24 Feb 2017, 10:05 AM

Please check my update on my question. 

 

Thank you

0
Ivan Danchev
Telerik team
answered on 27 Feb 2017, 02:45 PM
Hello Karthick,

Have you tried removing the required attribute from the AutoComplete's input? From the code you posted I see you are appending it with this attribute to the container in your AutoCompleteEditor function:
$('<input required="required" name="' + options.field + '"/>')


Regards,
Ivan Danchev
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
AutoComplete
Asked by
Karthick
Top achievements
Rank 1
Answers by
Ivan Danchev
Telerik team
Karthick
Top achievements
Rank 1
Share this question
or