How to stop the mandatory check if user change value from dropdown?

4 posts, 0 answers
  1. Wai Loon Ho
    Wai Loon Ho avatar
    11 posts
    Member since:
    Aug 2009

    Posted 10 Nov 2009 Link to this post


    Hi,

    I have a form which contains textbox and dropdown controls in which some textboxes are mandatory. If user change the value from the dropdown, system will need to retrieve data from database even the textboxed are blank.

    But now the system is not call back to backend for the data retrieve cause of the mandatory textboxes are blank.

    So, may I know what to do to stop the mandatory check if user change value from the dropdown?

    Thanks,
    Wai Loon
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 11 Nov 2009 Link to this post

    Hi Wai Loon,

    I guess you want validation either for textboxes or dropdownlist. If so, one suggestion would be using CustomValidator and check for the textbox value or whether the dropdown value has changed in the validate event handler. You can find out the clientside methods of RadTextBox and RadComboBox if you are usiing these controls.
    RadTextBox Client Object
    RadComboBox object

    Another option is by using WCF Web Service to retrieve the data from database.

    Regards,
    Shinu.
  3. Wai Loon Ho
    Wai Loon Ho avatar
    11 posts
    Member since:
    Aug 2009

    Posted 12 Nov 2009 Link to this post

    Hi,
    I don't want to validation for the dropdown.
    The drop down actually is a primary data.
    The screen actually is adding Card Group for an Account.

    The dropdown is Account list and the mandatory is checking on the Card Group Code and Card Group Name for the Account.

    User can change the Account from the dropdown, so when user change the Account, mandatory check for the Card Group Code and Card Group Name should not fired/happened.

    But currently, what happened is, when user change the Account from the dropdown. It should not shown the mandatory alert (textbox in red color) instead it should retrieve the Account details from database and show on screen and clear the Card Group Code + Card Group Name textbox.
  4. Yavor
    Admin
    Yavor avatar
    11 posts

    Posted 17 Nov 2009 Link to this post

    Hi Wai Loon Ho,

    If the textboxes, or any other inputs on the page, have required validators attached, on any postback the validators will be fired. Another option here would be to use separate validation groups for the dropdown, and the input controls. Another alternative would be to use client side code, and manually check the values of the control, if none of these standard approaches is suitable for you.
    I hope these suggestions help.

    Best wishes,
    Yavor
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Back to Top