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

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

3 Answers 69 Views
Input
This is a migrated thread and some comments may be shown as answers.
Wai Loon Ho
Top achievements
Rank 1
Wai Loon Ho asked on 11 Nov 2009, 05:44 AM

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

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 11 Nov 2009, 08:57 AM
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.
0
Wai Loon Ho
Top achievements
Rank 1
answered on 12 Nov 2009, 09:11 AM
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.
0
Yavor
Telerik team
answered on 17 Nov 2009, 09:36 AM
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.
Tags
Input
Asked by
Wai Loon Ho
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Wai Loon Ho
Top achievements
Rank 1
Yavor
Telerik team
Share this question
or