0

I am using user controls (.ascx) that each generate their own specific client validation functions using names like 'validate<%= NameTextBox.ClientID %>'. I would like to then call these validation functions from a higher level javascript function such as...

function checkControl(controlID) {
     //call validate function generated above using controlID 
     // instead of <%= NameTextBox.ClientID %>
}

I'd guess the syntax to call a concatenated function name is straight forward but I can't seem to find the answer. Any help would be greatly appreciated.

Thanks, Matt

1 Answer 1

1

You could do this:

function checkControl(controlID){
   // create a concatenated function name
   var myfuncname = controlid + '_somethingelse';
   // invoke the function 
   window[myfuncname]();
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.