勾选复选框并且数据字符串与JQUERY匹配时显示/隐藏数据

时间:2017-04-03 16:30:52

标签: javascript jquery checkbox

所以这是我的问题,我正在尝试在搜索字段中包含一个设施,如果您选中一个复选框,则需要删除任何具有data-isletagreed == 3的项目。

                

                @if (prop.isLetAgreed == 0)
                {
                    <span class="LetAgreed">
                        <p>FOR&nbsp;&nbsp;SALE</p>
                    </span>
                }
                @if (prop.isLetAgreed == 3)
                {
                    <span class="LetAgreed" style="left:20px;">
                        <p>NOW&nbsp;&nbsp;SOLD&nbsp;SSTC</p>
                    </span>
                }
                @if (prop.isLetAgreed == 2)
                {
                    <span class="LetAgreed">
                        <p>NOW&nbsp;&nbsp;SOLD</p>
                    </span>
                }
                <div class="portfolio-hover">
                    <div class="portfolio-hover-content">
                        <i class="fa fa-eye fa-3x"></i>
                    </div>
                </div>
                <img src="@prop.photo" class="img-responsive" alt="">
            </a>
            <div class="portfolio-caption">
                <h4>@Html.Raw(propertyNameNew)</h4>
                <div class="property-features">
                    <span><i class="fa fa-gbp"></i> @prop.price </span>
                    <span><i class="fa fa-bed"></i> @prop.maxtenants</span>

                </div>
            </div>

        </div>

    }
}

}     

这是我当前的搜索表单,我应该添加什么来使搜索按钮考虑到prop.isLetAgreed == 3以及是否选中了复选框。

            <div class="row search-input-group">
                <div class="col-md-6">
                    <div class="input-group">
                        <span style="min-width:150px" class="input-group-addon">Bedrooms</span>
                        <div class="dropdown searchRoomWebApi">
                            <button class="btn btn-default dropdown-toggle search-dropdownWebApi" type="button" id="dropdownMenu1" data-toggle="dropdown" aria-expanded="true">
                                <span class="txt">select</span>
                                <span class="caret"></span>
                            </button>
                            <ul class="dropdown-menu search-dropdown-menu" role="menu" aria-labelledby="dropdownMenu1">
                                <li role="presentation"><a role="menuitem" tabindex="-1" href="#">select</a></li>
                                <li role="presentation"><a role="menuitem" tabindex="-1" href="#">1</a></li>
                                <li role="presentation"><a role="menuitem" tabindex="-1" href="#">2</a></li>
                                <li role="presentation"><a role="menuitem" tabindex="-1" href="#">3</a></li>
                                <li role="presentation"><a role="menuitem" tabindex="-1" href="#">4</a></li>
                                <li role="presentation"><a role="menuitem" tabindex="-1" href="#">5</a></li>
                                <li role="presentation"><a role="menuitem" tabindex="-1" href="#">6</a></li>
                            </ul>
                        </div>

                    </div>
                </div>
                <div class="col-md-6">
                    <div class="input-group">
                        <span style="min-width:150px" class="input-group-addon">Maximum Price</span>
                        <div class="dropdown searchPriceWebApi">
                            <button class="btn btn-default dropdown-toggle search-dropdownWebApi" type="button" id="dropdownMenu1" data-toggle="dropdown" aria-expanded="true">
                                <span class="txt">select</span>
                                <span class="caret"></span>
                            </button>
                            <ul class="dropdown-menu search-dropdown-menu" role="menu" aria-labelledby="dropdownMenu1">
                                <li role="presentation"><a role="menuitem" tabindex="-1" href="#">select</a></li>
                                <li role="presentation"><a role="menuitem" tabindex="-1" href="#">£100000</a></li>
                                <li role="presentation"><a role="menuitem" tabindex="-1" href="#">£200000</a></li>
                                <li role="presentation"><a role="menuitem" tabindex="-1" href="#">£300000</a></li>
                                <li role="presentation"><a role="menuitem" tabindex="-1" href="#">£400000</a></li>
                                <li role="presentation"><a role="menuitem" tabindex="-1" href="#">£500000</a></li>
                            </ul>



                        </div>
                    </div>
                </div>

                <div class="col-md-6 col-md-offset-3">
                    <a id="btnSearchPropertyWebApi" style="width:100%" href="#" class="btn btn-default">
                        <span class="glyphicon glyphicon-search"></span> <span class="txt">Search</span>
                    </a>
                </div>

            </div>

0 个答案:

没有答案