如何将Source和Args参数传递给Javascript函数 [英] How to pass Source and Args parameters to Javascript function

查看:199
本文介绍了如何将Source和Args参数传递给Javascript函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有javascript函数

I have javascript function

function Custom(source,Args) {
            var txt = document.getElementById('<%=TextBox3.ClientID %>').value;
            if (txt == 2) {
                Args.IsValid = true;
                return;
            }
            source.innerText = "Enter 2";
            Args.IsValid = false;
            return ;



我必须在按钮 OnClientClick =上调用此functoin返回ButtonFunc();但我的问题是在Custon函数中传递的参数。这是我的 ButtonFunc 函数


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;
        }

推荐答案

检查



http://stackoverflow.com/questions/4012387/custom-validator-error-text-through-javascript [ ^ ]



也提醒检查,可能无法验证。

我认为

将如果(txt =='2')
Check for

http://stackoverflow.com/questions/4012387/custom-validator-error-text-through-javascript[^]

also put a alert to check,might its unable to validate.
I think
will be if (txt == '2')


这篇关于如何将Source和Args参数传递给Javascript函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆