html radio check
{% if classes|count > 1 %}
<div class="class_checkbox" id="class_checkbox">
<label class="class_checkbox_button">
<input type="radio" name="classes" value="" {{ 'checked' if not class_id}}>
全部
</label>
{% for c in classes %}
<label class="class_checkbox_button">
<input type="radio" name="classes" value="{{c['class_id']}}" {{ 'checked' if c['class_id'] == class_id}}>
{{c['name']}}
</label>
{% endfor %}
</div>
{% endif %}
$('#class_checkbox input[type="radio"]').change(function() {
var class_id = $("input[name='classes']:checked").val();
var path = window.location.pathname;
if(class_id){
path += '?class_id='+class_id;
}
window.location.href = path;
});
html radio check的更多相关文章
- radio,check美化
单选框与复选框原生控件美化有多种解决方案,现在采用经典的input+label的方式自己实现一种 思路: input 和label 通过id和for属性关联,点击label时,input选中状态改变 ...
- [label][翻译][JavaScript]如何使用JavaScript操纵radio和check boxes
Radio 和 check boxes是form表单中的一部分,允许用户通过鼠标简单点击就可以选择.当与<textarea>元素的一般JavaScript操纵相比较,这些表单控件(form ...
- JQuery基础总结上
最近在慕课网学习JQuery基础课程,发现只是跟随网站的课程学习而不去自己总结扩展的话,很难达到真正学会理解的地步. 于是先在网站上草草过了一遍课程,然后借着今天的这个时间边记录边重新整理学习一下. ...
- 在表单中元素的onchange事件的兼容性问题
onchange:在值发生改变的时候触发 text:当光标离开的时候如果内容有变化就触发 radio/check:标准浏览器下点击的时候只要值变了就触发 非标准浏览器下焦点离开的时候如果值变了就触发
- Windows API 常量定义
Windows 常量定义在winuser.h中可以找到,如果了安装了visual studio 2010,winuser.h所在目录为C:\Program Files (x86)\Microsoft ...
- JQuery 操作input
获取选中的值 获取一组radio被选中项的值 var item = $('input[@name=items][@checked]').val(); 获取select被选中项的文本 var item ...
- Bootstrap入门(五)表单
Bootstrap入门(五)表单 先引入本地的CSS文件 <link href="css/bootstrap.min.css" rel="stylesheet ...
- Vue(六) 表单与 v-model
学习使用 v-model 指令完成表单数据双向绑定 基本用法 表单控件在实际业务较为常见,比如单选,多选.下拉选择.输入框等,用他们可以完成数据的录入.校验.提交等.Vue.js 提供了 v-mode ...
- Ext.js入门:Window对象与FormPanel(六)
一:Ext.Window类 二:Ext.Window类实例 三:Ext.FormPanel类 四:Ext.FormPanel类实例 1.类Ext.Window 包: Ext 定义的文件 Windo ...
随机推荐
- python 线程之 threading(三)
python 线程之 threading(一)http://www.cnblogs.com/someoneHan/p/6204640.html python 线程之 threading(二)http: ...
- PHP 删除目录及目录下文件
<?php function del_dir ($dir,$type=true){ $n=0; if (is_dir($dir)) { if ($dh = opendi ...
- ASIHttpRequest 使用理解
开源库:ASIHttpRequest ASIHttpRequest 下载网址:http://github.com/pokeb/asi-http-request 依赖的5个库文件:CFNetwork, ...
- java调用url接口
很多简单的接口就是直接一个URl的形式, 怎么调用? HttpClient httpclient=null; PostMethod post=null; try{ httpclient = new H ...
- C# 转换符的重载 显示、隐式转换
class Complex { //保存转换的值 Int32 v; public Complex(Int32 x) { v = x; } public Int32 ToInt32() { return ...
- JS创建缩略图
<script language="javascript"> //显示缩略图 function DrawImage(ImgD,width_s,height_s){ /* ...
- C#中的简单工厂和单例
下面首先来说说简单工厂 举个例子: 首先是父类 public abstract class Pizza { public abstract string Info(); } } 子类 public c ...
- 【iCore3 双核心板】例程三十六:DAC实验——输出直流电压
实验指导书及代码包下载: http://pan.baidu.com/s/1bRVnzS iCore3 购买链接: https://item.taobao.com/item.htm?id=5242294 ...
- php上传大文件,提示出错
- Nginx多个域名,https redirect to http
背景描述:Nginx绑定多个域名,其中一个域名配置了https,如域名A:https://www.aaa.com:另外的域名B(http://www.bbb.com)没有配置SSL证书, 问题:以ht ...