RadDropDownList not working properly with RequiredFieldValidator

7 posts, 0 answers
  1. nfigueroa
    nfigueroa avatar
    21 posts
    Member since:
    Apr 2010

    Posted 10 Apr 2013 Link to this post

    Hi

    We just updated to the most recent 2013 Q1 upgrade of ASP.NET tools, and all of the sudden the RadDropDownLists are not working properly with the RequiredValidators,  The validators keep showing messages even though there's content on the dropdowns.  The latest browsers versions of Chrome and IE have this problem.  

    Curiously, with IE version 8 this problem does not occur!

    I'd appreciate any help or bug fix for this as it is a critical problem


    Thanks in advance
    Neftali Figueroa
  2. Helen
    Admin
    Helen avatar
    1052 posts

    Posted 12 Apr 2013 Link to this post

    Hello,

    Which are the exact controls that you use? Could you please open a support ticket and send us a sample project which demonstrates the issue to examine it locally?

    Kind regards,
    Helen
    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. nfigueroa
    nfigueroa avatar
    21 posts
    Member since:
    Apr 2010

    Posted 12 Apr 2013 Link to this post

    Hi Helen

    Thanks for the reply!  As I mentioned before, the controls are DropDownList with the asp RequiredFieldValidator.  It was working perfectly until I applied the latest Telerik ASP.NET controls upgrade (version 2013.1.403.35),  I will create a support ticket and send you sample project!

  5. Owen
    Owen avatar
    12 posts
    Member since:
    May 2013

    Posted 10 May 2013 Link to this post

    Still not working using 2013.1.417.40. Our web app was using RadComboBox, but the bottom of the menu was cut off when closed. I converted to the RadDropDownList and now asp:RequiredFieldValidator no longer works even though there is a value selected.

    By no longer works, I mean that it will say that nothing is selected even though there is a selected value and trigger failed validation.

    RadDropDownList populates correctly and is selectable from codebehind. It just fails validation on the client side aspx.

    If I manually select another value after the codebehind has selected, then it works.


    Aspx code:

        <telerik:RadDropDownList ID="State" runat="server" Skin="Office2010Silver"
    BackColor="#FFF9BD"  CausesValidation="false" />
        <asp:RequiredFieldValidator ID="ReqState" ControlToValidate="State"
    ErrorMessage="A state is required." Text="*"
    CssClass="validationFail" SetFocusOnError="True" runat="server" />


    If the program selects, I don't get a value= in the <input> section:
    <input id="ctl00_PrimaryContent_State_ClientState" name="ctl00_PrimaryContent_State_ClientState"
    type="hidden" autocomplete="off">


    If I manually select, I get the following which includes the needed "value=" portion.
    <input id="ctl00_PrimaryContent_State_ClientState" name="ctl00_PrimaryContent_State_ClientState"
    type="hidden" autocomplete="off"
    value="{"enabled":true,"logEntries":[],"selectedIndex":3,
    "selectedText":"American%20Samoa","selectedValue":"AS"}"
    >

    I've tried to set the SelectedValue as well as the Selected Index:
    State.SelectedValue = row["State"].ToString();
    State.SelectedIndex = PropState.FindItemByValue(row["State"].ToString()).Index;

    Both versions set what is displayed to the correct item, but the value doesn't load.
  6. Ross Dunham
    Ross Dunham avatar
    11 posts
    Member since:
    Mar 2006

    Posted 10 May 2013 Link to this post

    I believe I am seeing similar behavior in my application.
    If I use the arrow keys to select a value and then tab to the next field, the required field validator will fail validation.
    I have to manually click with the mouse for the validator to sense a choice was made to pass validation.

    Im guessing a bug?  I just wanted to confirm.

    Thanks!



  7. Owen
    Owen avatar
    12 posts
    Member since:
    May 2013

    Posted 13 May 2013 Link to this post

    Ross, I have confirmed that the arrow keys fail to set the value= in the <input> tag as well. The <span class="rddlFakeInput" value=""> changes as the displayed value is changed. However, it seems that only a click event is setting the value= of the <input> tag.
  8. Owen
    Owen avatar
    12 posts
    Member since:
    May 2013

    Posted 13 May 2013 Link to this post

    Well, I have reverted my project back to the RadComboBox to get the requisite funcionality back. Also, the  rcbReadOnly height is 1 pixel too small at 21px. This cuts the bottom off of the closed menu graphic which looks a bit trashy. I had to implement this little CSS snippet to fix it:

    /* RadComboBox bottom cut off fix */
    .rcbReadOnly {
        height: 22px;
    }


    Regards,
    Owen
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017