We are using Integer Text box with Spinners, where user can increase or decrease value.
Scenario: We are enabling and disabling text box from JavaScript. Text Box is going disabled but Spinners is still active, where user can modify value.
follow the following options tried:
1. DIV tag enable / disabled all controls (Enable / Disable Text Box but still spinner is enabled)
2. Using onFocus called onBlur (Still is not working)
3. Remove CSS Classs "$('#txt').removeClass('t-widget t-numerictextbox').removeAttr('disabled');"
refer attached screen shot.
Code:
@(Html.Telerik().IntegerTextBox()
.Name("txt")
.MinValue(1)
.MaxValue(24)
.Value(1)
.InputHtmlAttributes(new { style = " height:23px; line-height:normal; vertical-align:middle; width:40px;" })
.HtmlAttributes(new { style = " width:40px; " })
)
Javascript Code for Enable and Disable Controls:
function SetDisabled(el, val) {
try {
el.disabled = val;
}
catch (E) { }
if (el.childNodes && el.childNodes.length > 0) {
for (var x = 0; x < el.childNodes.length; x++) {
SetDisabled(el.childNodes[x], val);
}
}
}
Thanks in Advance.
Regards,
HARI
