Posted on: 8/30/2013 5:14:10 PM | Views : 270

Can I call the same function to custom validate four controls?
I'm using this
function ChangeColour(source, args) { var cboCostC = document.getElementById('<%= cboCostC.ClientID %>'); var StrValue = "Choose One"; if (args.Value == StrValue) { cboCostC.style.background = "Red"; args.IsValid = false; } else { cboCostC.style.background = 'LightGreen'; args.IsValid = true; } to validate the first one on my form and it works fine (the control is named cboCostC).  The other controls are named cboDisb, cboRec and cboIGA.
I'm guessing I'd need to put some conditions in this code based on what control was active at the time of validation but I don't know what (this is my first exposure to JavaScript).
Or is it simpler to use a different function for each control?
...

Go to the complete details ...