<p>
<input type="checkbox" class="ischecked" id="is_pinkage" name="" value="" <?php if($request->input('is_pinkage') == '1'): ?>checked <?php endif; ?> />包配送
  
<input type="checkbox" class="ischecked" id="is_24h" name="" value="" <?php if($request->input('is_24h') == '1'): ?>checked <?php endif; ?> />24小时内发货  
<input type="checkbox" class="ischecked" id="is_7goodsreturn" name="" value="" <?php if($request->input('is_7goodsreturn') == '1'): ?>checked <?php endif; ?> />7+天包退
  
<input type="checkbox" class="ischecked" id="is_15renew" name="" value="" <?php if($request->input('is_15renew') == '1'): ?>checked <?php endif; ?> />15+天换新  
<input type="checkbox" class="ischecked" id="is_aftermarket" name="" value="" <?php if($request->input('is_aftermarket') == '1'): ?>checked <?php endif; ?> />售后保障 
 
<input type="checkbox" class="ischecked" id="is_wholesale" name="" value="" <?php if($request->input('is_wholesale') == '1'): ?>checked <?php endif; ?> />批发   </p>

js代码

<script type="text/javascript">
$(".ischecked").click(function(){
//当点击按钮处于checked则跳转
if($(this).is(":checked")){
var add;
var url = location.search;
if (url.indexOf("?") != -1) {
add = window.location.href + "&" + $(this).attr('id') + "=1";
}else{
add = window.location.href + "?" + $(this).attr('id') + "=1";
}
window.location.href = add;
}else{
//当点击按钮处于非checked则跳转
var url1 = window.location.href;
var ref = $(this).attr('id');
var add2 = delQueStr(url1,ref);
window.location.href = add2;
}
}) function delQueStr(url, ref) {
//根据跳转情况删除相应的字段
var str = "";
if (url.indexOf('?') != -1) {
str = url.substr(url.indexOf('?') + 1);
}
else {
return url;
}
var arr = "";
var returnurl = ""; if (str.indexOf('&') != -1) {
arr = str.split('&');
for (i in arr) {
if (arr[i].split('=')[0] != ref) {
returnurl = returnurl + arr[i].split('=')[0] + "=" + arr[i].split('=')[1] + "&";
}
}
return url.substr(0, url.indexOf('?')) + "?" + returnurl.substr(0, returnurl.length - 1);
}
else {
arr = str.split('=');
if (arr[0] == ref) {
return url.substr(0, url.indexOf('?'));
}
else {
return url;
}
}
} </script>

input按钮选择功能的更多相关文章

  1. input按钮事件的一个隐藏bug,分享出来

    我的页面有一个input按钮: <input name="Delete" type="button" value="Delete" c ...

  2. 表单input按钮在各浏览器之间的兼容性

    从网上看了这篇关于表单input按钮的浏览器兼容性问题,总结的还不错,所以copy下来学习下. input按钮在各个浏览器之间的兼容性问题,看下边这段代码: input.item { backgrou ...

  3. 前端福利之表单input按钮在各浏览器之间的兼容性(转)

    从网上看了这篇关于表单input按钮的浏览器兼容性问题,总结的还不错,所以copy下来学习下. input按钮在各个浏览器之间的兼容性问题,看下边这段代码: input.item { backgrou ...

  4. 在vue组件的stylus样式总 取消search类型的input按钮中默认样式

    在vue组件的stylus样式中 取消search类型的input按钮中默认样式 记录一个坑 环境 Vue组件 使用了Stylus的CSS风格. 问题 input输入框使用了 type="s ...

  5. input按钮的事件处理大全

    input按钮的事件处理大全   input按钮的事件处理大全1.<INPUT onclick=document.all.WebBrowser.ExecWB(1,1) type=button v ...

  6. 利用css去除input按钮上的文字的几种方法

    相信很多时候input上的文字困扰着web前端开发者,必须要通过修改html代码中的value值才能清空按钮上的文字,但很多人不愿意去动html代码,一方面麻烦,另外主要的原因还在于保留文字对seo有 ...

  7. 阻止移动端input按钮聚焦时唤起软键盘的方法

    一.设置input为readonly 二.使用JS代码,在input按钮fous时就让其blur

  8. 设置苹果手机input按钮和button按钮颜色显示问题

    网页上,尽管设置了input按钮和button的背景颜色,但在苹果手机上测试时仍会发现背景颜色为透明渐变色,不起作用,怎么解决呢? 在css公共样式中加上下面代码就可以解决,去除button和inpu ...

  9. iphone中input按钮设置disabled属性出现灰色背景没有显示问题

    在项目中发现发送验证码的按钮,在点击后添加disabled属性后,iphone手机中出现disabled属性的默认背景颜色没有显示,反而直接显示它下面的父级元素的白色 点击前 点击后 倒计时的按钮消失 ...

随机推荐

  1. FileZilla的使用(包括Server和Client两个程序)

    1.安装 FileZillaServer和FileZillaClient,到官网去下载 https://filezilla-project.org/ 2.启动 FileZillaServer 它会提示 ...

  2. 如何在ThinkPHP中开启调试模式

    1.为什么使用调试模式? 因为调试会在我们的模板页的最后增加一些trace信息. 2.什么是trace信息? 是ThinkPHP为我们提供好的一些包含了系统运行时间.占用内存.加载时间.请求的协议.. ...

  3. springMVC静态资源访问

    springMVC默认是访问不到静态资源的,如css,js等,需要在xml里进行配置 保证已经配置好了 web.xml, <!-- Spring MVC servlet --> <s ...

  4. The Java serialization algorithm revealed---reference

    Serialization is the process of saving an object's state to a sequence of bytes; deserialization is ...

  5. ubuntu系统操作

    给ubuntu配置解析主机名 vim  /etc/hosts 192.168.23.44  Evelyn

  6. JS常用的设计模式(3)-——观察者模式

    观察者模式( 又叫发布者-订阅者模式 )应该是最常用的模式之一. 在很多语言里都得到大量应用. 包括我们平时接触的dom事件. 也是js和dom之间实现的一种观察者模式. div.onclick = ...

  7. js面向对象3

    1.this的使用 核心:在js中,this表示当前对象,“谁”调用了当前函数,“this”就指向了“谁” 语法: Function 类(){ this.属性=值; } 例1.在构造器中,使用this ...

  8. [转]ASP.NET MVC实现POST方式的Redirect

    本文转自:http://www.cnblogs.com/ryuasuka/p/3604452.html?utm_source=tuicool 我们知道,在ASP.NET MVC中,要从一个Action ...

  9. node.js分片上传文件

    前端 : <html> <head> <title>分片上传文件</title> </head> <body> <div ...

  10. 浅谈------location

    今天在上班的时候碰到了要根据不同的页面随机添加栏目的问题,很简单的问题,想到了判断页面url是否含有某字符串来进行随机添加栏目...这就需要了解location对象. location 属性名 属性说 ...