Hello,
I am trying to validate a valid item is typed into one of my combo's with load on demand enabled and I am having a hard time with the javascript. I want to re-use a function for multiple combobox's.
I am trying to validate a valid item is typed into one of my combo's with load on demand enabled and I am having a hard time with the javascript. I want to re-use a function for multiple combobox's.
| function ValidateComboUser(source, args) |
| { |
| var combo = $find(source.ControlToValidate.ClientID); |
| args.IsValid = ValidateCombo(combo); |
| } |
| function ValidateCombo(combo) |
| { |
| var isValid = false; |
| var text = combo.get_text(); |
| var item = combo.findItemByText(text); |
| if (item) |
| { |
| isValid = true; |
| } |
| return isValid; |
| } Can someone please help me with a way to get the combo box being validated through the function params? Thanks |
