RadcomboBox & RequiredFieldValidator

7 posts, 0 answers
  1. Mohamed
    Mohamed avatar
    25 posts
    Member since:
    Feb 2008

    Posted 25 May 2008 Link to this post

    Hi all

    I find problem with RadcomboBox & RequiredFieldValidator

    RadcomboBox  it bound with table in database name country
    in databound event i add this

    cboxCountry.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("-  Select  -", null));

    this for insert text SELECT to be default

    when i add RequiredFieldValidator and set its propriety in design time like
    ControlToValidate = cboxCountry
    InitialValue = -  select  -

    and run this page
    when it run and click on button next it fire the RequiredFieldValidator 
    and it works
    but when select another item like USA and return to "-  select  -"
    and press NEXT button it didn't fire RequiredFieldValidator   

    how can control  it ??
  2. Rosi
    Admin
    Rosi avatar
    2527 posts

    Posted 27 May 2008 Link to this post

    Hi Mohamed,

    Please have a look at our online example on Validation. Could you reproduce the same issue with it?

    Also,could you please open a support ticket and send us a simple running project to test it locally? We will review it and provide you with a solution or more specific instructions.


    Regards,
    Rosi
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Mohamed
    Mohamed avatar
    25 posts
    Member since:
    Feb 2008

    Posted 31 May 2008 Link to this post

    Hi Rosi ,
    i use win 2008 server
    I still find problem in validating combobox
    when select value other "Select city" in fire compare validator and its OK
    but when turn back by button browser Back and value in combobox NotEqual "Select city"  and press Enter button it also fire compare validator  and this not correct
    you can check it in demos

    http://www.telerik.com/DEMOS/ASPNET/Prometheus/ComboBox/Examples/Functionality/Validation/DefaultCS.aspx



    this case also happened when add combobox in Microsoft wizard
    and use Next,Previous buttons


  5. Rosi
    Admin
    Rosi avatar
    2527 posts

    Posted 02 Jun 2008 Link to this post

    Hello Mohamed,

    Please try the following javascript:

    <script type="text/javascript">  
     
    function pageLoad()  
    {  
        var combo =$find("RadComboBox1");  
        if(combo.get_text()!=" - Select a City - ")  
            combo.findItemByText(combo.get_text()).select();  
    }  
    </script> 

    This should helps.

    Regards,
    Rosi
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  6. a a
    a a avatar
    1 posts
    Member since:
    Aug 2009

    Posted 10 Jul 2013 Link to this post

    Hi,

    We are experiencing same issue.

    We have a radcombobox which has requiredfieldvalidator associated with it. For the first time it validates the required value, but if we select some value from dropdown and then select the "--Select--" back in the dropdown, its not validated by requiredfieldvalidator. We have tried InitalValue of requiredfieldvalidator with both "Text" and "Value" of 1st item in the dropdown (1st item is --select--).

    Please help.
  7. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 11 Jul 2013 Link to this post

    Hi

    Please check the following code I tried which works fine at my end.

    ASPX:
    <telerik:RadComboBox ID="RadComboBox1" runat="server">
        <Items>
            <telerik:RadComboBoxItem runat="server" Text="Select" />
            <telerik:RadComboBoxItem runat="server" Text="Item 1" />
            <telerik:RadComboBoxItem runat="server" Text="Item 2" />
            <telerik:RadComboBoxItem runat="server" Text="Item 3" />
            <telerik:RadComboBoxItem runat="server" Text="Item 4" />
        </Items>
    </telerik:RadComboBox>
    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="RadComboBox1"
        InitialValue="Select" ForeColor="Red">*
    </asp:RequiredFieldValidator>

    Thanks,
    Shinu.
  8. Andy
    Andy avatar
    54 posts
    Member since:
    Jun 2009

    Posted 23 Mar Link to this post

    In the demo validation passes if you just type any text into product and region comboboxes. I'm using custom validator for comboxboxes with custom text allowed and check if both selected value and text are not empty. Is there's a better way round?
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017