-1

I have a condition where I need to apply validation in a dxtextbox based on the dxselectbox value. ie,if I am selecting either of the first two values in the dropdown then the the validation for the textbox should be on,else it should be off. Can some one please help me to solve this.Its urjent.

vickey
  • 53
  • 1
  • 12

1 Answers1

0

You can use the onValueChanged event of dxSelectBox to turn on/off the validation.

var validateTextBox = true;
$("#selectbox").dxSelectBox({
    //...
    onValueChanged: function(e) {
        if(e.value === 1) {
            validateTextBox = true;
        } else {
            validateTextBox = false;
        }
    }
});

Then use the validateTextBox value to choose validate or not the textbox.

The sample is here - http://jsfiddle.net/h9j87qva/

Sergey
  • 5,396
  • 3
  • 26
  • 38