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

Validation

3 Answers 131 Views
AutoCompleteBox
This is a migrated thread and some comments may be shown as answers.
David
Top achievements
Rank 1
David asked on 10 Jan 2017, 11:37 PM

Can I run a standard ASP.NET compare validator on the autocompletebox? I want to test if the initial value was changed. If not trigger it. I running this in dropdownlist mode.

 

Thanks!

3 Answers, 1 is accepted

Sort by
0
Nencho
Telerik team
answered on 13 Jan 2017, 11:30 AM
Hello David,

Could you please elaborate a bit more on the usage of the CompareValidator, so we could have more context on the issue and locally tests it. Provide us with a sample code snippet of the utilization at your end.

I am looking forward to your reply.

Regards,
Nencho
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
David
Top achievements
Rank 1
answered on 13 Jan 2017, 01:38 PM
On things like dropdowns I usually use the compare validator as a required field validator as opposed to the standard required field validator. Since I have text already in the box to start, my initial value, I was just wondering if I can use that as the property and will it validate.
0
Nencho
Telerik team
answered on 18 Jan 2017, 08:43 AM
Hello David,

Since the RadAutoComplete entries are not contained in the input of the control, I would suggest you to use a CustomValidator and a HiddenField. You can set the value of the HiddenFIeld regarding the currently contained entries in the AutoComplete at page load.

In addition, you can use the ClientValidate function of the CustomValidator, in order to implement the comparison. In the attachment you can find a sample example, demonstrating the above suggestion.


Regards,
Nencho
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
AutoCompleteBox
Asked by
David
Top achievements
Rank 1
Answers by
Nencho
Telerik team
David
Top achievements
Rank 1
Share this question
or