功能不正常 [英] function not work proper

查看:67
本文介绍了功能不正常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<input id="CHAMPARAN_EAST" name="CHAMPARAN EAST" onclick="SearchDistict('CHAMPARAN EAST');" type="checkbox" value="34">

function SearchDistict(obj) 
{
        debugger;
        if (obj.checked) 
         {
          districtCollection.push(obj.value);
         }
        else {
            districtCollection.pop(obj.value);
            //districtCollection.splice($.inArray(obj.value, districtCollection),1);

        }
        var postData = preparingSearch();
        debugger;
        postData.StateList = '';
        postData.DistrictList = districtCollection;
        SearchEngine();
        //CallSearchBorrower(postData);
    }



当我们调用SearchDistict('CHAMPARAN EAST')它的工作但它不会调用if语句


when we call SearchDistict('CHAMPARAN EAST') its work but it not invoke if statement

推荐答案

.inArray(obj.value) ,districtCollection),1);

}
var postData = preparingSearch();
调试器;
postData.StateList = ' ';
postData.DistrictList = districtCollection;
SearchEngine();
// CallSearchBorrower(postData);
}
.inArray(obj.value, districtCollection),1); } var postData = preparingSearch(); debugger; postData.StateList = ''; postData.DistrictList = districtCollection; SearchEngine(); //CallSearchBorrower(postData); }



当我们调用SearchDistict('CHAMPARAN EAST')它的工作但它不调用if语句


when we call SearchDistict('CHAMPARAN EAST') its work but it not invoke if statement


(你将控制名称作为字符串并在函数内,用它作为对照。[string!= control])





这是修复:

1.重命名与id相同的复选框名称属性。

2.将控制名称作为参数传递。



(You are passing control name as string and within the function, using it as a control. [string != control])


Here is the fix:
1. Rename your checkbox name attribute same as id.
2. Pass control name as parameter.

<input id="CHAMPARAN_EAST" name="CHAMPARAN_EAST" onclick="SearchDistict('CHAMPARAN_EAST');" type="checkbox" value="34">

function SearchDistict(obj)
{
var ctrl =


(#+ obj);


这篇关于功能不正常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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