Click here to Skip to main content
15,790,267 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have javascript function
function Custom(source,Args) {
            var txt = document.getElementById('<%=TextBox3.ClientID %>').value;
            if (txt == 2) {
                Args.IsValid = true;
            source.innerText = "Enter 2";
            Args.IsValid = false;
            return ;

and i have to call this functoin on button OnClientClick="return ButtonFunc();" but my problem is what parameters to pass in Custon Function .Here is my ButtonFunc Function
function ButtonFunc() {
            if (Custom()) { //What Parameter to pass for source and Args ??
                return true;
            return false;
Ankit Dhiman 1-Aug-13 2:24am    
Can any one help me please .
Mukesh Ghosh 1-Aug-13 2:57am    
Can you explain why you need such function or what is your objective?
Ankit Dhiman 1-Aug-13 3:20am    
Custom Function is ClientValidationFunction of CustomValidator and i wamt when user enter wrong value Custom Validator show thw error and button do not saves the data .What happening rght now is Custom Validator is displaying the error but it is submitting too with wrong value.
Ankit Dhiman 1-Aug-13 3:29am    

1 solution

Check for[^]

also put a alert to check,might its unable to validate.
I think
will be if (txt == '2')
Share this answer
Ankit Dhiman 1-Aug-13 7:28am    
This is in my knowledge .But i dnt want Custom Validator ClientFunction to cal i want to call that function on button clientclick function not on Custom Validator ClientFunction

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900