LoadOnDemand and CustomValidator

3 posts, 1 answers
  1. Berlioz
    Berlioz avatar
    9 posts
    Member since:
    Jun 2012

    Posted 27 Nov 2011 Link to this post

    How do you use the CustomValidator and RadComboBox together WHEN LOADONDEMAND is enabled??? Because If user wants to supply a value freehand by typing it in, I have to 1.make sure it is not left on "--- PLEASE SELECT---"  2. check input value against a regex, 2. insert the value into the db if not already there. Please help!
  2. Answer
    Kevin avatar
    360 posts
    Member since:
    Jul 2012

    Posted 28 Nov 2011 Link to this post

    Hello Daniel,

    I posted on your other topic, but I'm assuming this is the real issue you want answered. The way I validate the RadComboBox when I used LoadOnDemand is like so:

    if (dropDown.get_text() != null && dropDown.get_text() != dropDown.get_emptyMessage()) {
                        args.IsValid = true;

    I hope that helps.
  3. Ivana
    Ivana avatar
    657 posts

    Posted 29 Nov 2011 Link to this post

    Hello Daniel,

    Yes, Kevin is right about the empty text and the empty message check.

    If you want to save the text typed in the input field, in a database, you could, before a post-back to the server is made, check if an item with such a text already exist in the items collection. To achieve this, you could use the FindItemByText(text) method of the RadComboBox's client object.

    For more information about the client-side API of the RadComboBox, you could refer to the following help article: RadComboBox: Client-side API.

    I hope this helps.

    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
Back to Top