radio

Processing radio buttons in loop in PHP

霸气de小男生 提交于 2020-01-25 05:03:36
问题 I have a loop that iterates 3 times. Inside the loop I have a HTML form that has radio buttons. I'm processing the input using PHP. When I echo the form data, its not showing the correct values. Is it a wrong way of processing the data ? Any help is appreciated. test.php <?php for ($i = 1; $i <= 3; $i++) { ?> <form action = 'test.php' method = 'post'> <input type="radio" name="num<?php echo $i; ?>" value="one">One<br> <input type="radio" name="num<?php echo $i; ?>" value="two">Two </form> <

自定义input[type=\"radio\"]的样式

只谈情不闲聊 提交于 2020-01-19 12:47:52
对于表单,input[type="radio"] 的样式总是不那么友好,在不同的浏览器中表现不一。 2017年11月28日更新 对单选按钮自定义样式,我们以前一直用的脚本来实现,不过现在可以使用新的伪类 :checkbox 来实现。 如果直接对单选按钮设置样式,那么这个伪类并不实用,因为没有多少样式能够对单选按钮起作用。不过,倒是可以基于单选按钮的勾选状态 借助组合选择符来给其他元素设置样式。 很多时候,无论是为了表单元素统一,还是为了用户体验良好,我们都会选择 label 元素和 input[type="radio"] 一起使用。 当<label>元素与单选按钮关联之后,也可以起到触发开关的作用 。 思路: 1. 可以为<label>元素添加生成性内容(伪元素),并基于单选按钮的状态来为其设置样式; 2. 然后把真正的单选按钮隐藏起来; 3. 最后把生成内容美化一下。 解决方法: 1. 一段简单的结构代码: <div class="female"> <input type="radio" id="female" name="sex" /> <label for="female">女</label> </div> <div class="male"> <input type="radio" id="male" name="sex" /> <label for="male">男<

layui check,radio,select使用

依然范特西╮ 提交于 2020-01-18 09:35:36
<form class="layui-form" action=""> <blockquote class="layui-elem-quote">基本信息</blockquote> <div class="layui-form-item"> <label class="layui-form-label">所在城市</label> <div class="layui-input-block"> <input type="checkbox" name="cityCheckbox" value="NJ" title="南京"> <input type="checkbox" name="cityCheckbox" value="SZ" title="苏州"> <input type="checkbox" name="cityCheckbox" value="WX" title="无锡"> </div> </div> <div class="layui-form-item"> <label class="layui-form-label ">所在城市</label> <div class="layui-input-block"> <input type="radio" name="cityRadio" value="N" title="南京"> <input type="radio"

Radio Boxes not resetting to “checked” status in Firefox

佐手、 提交于 2020-01-17 04:40:14
问题 I'm lost as to why my radio box form isn't working in Firefox 7.0.1, but works fine in IE, Chrome and Safari. The problem is that the radio boxes which are "checked" aren't resetting to what the HTML shows. For example, if I change the temperature setting from "f" to "c" and and press Select, the action script sees the correct values. I then press Back in FF and refresh the window, "c" is still selected. As stated, this works as expected in other browsers, but not in FF. I'm having a hard

radio button - how to check a link and send user to URL

╄→尐↘猪︶ㄣ 提交于 2020-01-16 18:09:09
问题 I'm trying to find the best way of checking a url based on a radio button selection. On my page, I have at least 5 pairs of radio buttons. Can someone tell me what's the best way of sending the user to the correct url based on their selected radio button? $(document).ready(function () { $("*[type=radio]").change(function () { alert( $(this).attr("value")) }) }); see more code: jsfiddle 回答1: Based on your jsfiddle, your radio button pairs are named in sequential order: the first pair is named

radio button - how to check a link and send user to URL

别说谁变了你拦得住时间么 提交于 2020-01-16 18:08:25
问题 I'm trying to find the best way of checking a url based on a radio button selection. On my page, I have at least 5 pairs of radio buttons. Can someone tell me what's the best way of sending the user to the correct url based on their selected radio button? $(document).ready(function () { $("*[type=radio]").change(function () { alert( $(this).attr("value")) }) }); see more code: jsfiddle 回答1: Based on your jsfiddle, your radio button pairs are named in sequential order: the first pair is named

How to transform a radio input form to radio input bootsfaces form?

馋奶兔 提交于 2020-01-16 04:55:08
问题 Is it possible to transform the next code to bootsfaces labels? <div class="radio"> <label><input type="radio" name="optradio"/>Option 1</label> </div> <div class="radio"> <label><input type="radio" name="optradio"/>Option 2</label> </div> Thank you! 回答1: Update July 18, 2016: Inspired by your question, I've started to implement a <b:radiobutton /> component that's more flexible than its standard JSF counterpart. It will be published with the next version of BootsFaces - probably 1.0, which

纯CSS3美化单选按钮radio

烂漫一生 提交于 2020-01-16 03:59:27
这种纯CSS3美化单选按钮radio的方法适用于以下情况: 1、可兼容IE9以上,需要兼容IE8的要写IE的hack把样式去掉 2、只支持单选按钮radio,因为单选按钮选中样式的圆圈可以用CSS做出来,但是复选按钮checkbox的选中效果对勾就需要图片或者图标字体库 3、不需要JS支持切换效果 下图是最终效果图: HTML代码: <label for="man" class="radio"> <span class="radio-bg"></span> <input type="radio" name="sex" id="man" value="男" checked="checked" /> 男 <span class="radio-on"></span> </label> <label for="woman" class="radio"> <span class="radio-bg"></span> <input type="radio" name="sex" id="woman" value="女" /> 女 <span class="radio-on"></span> </label> CSS代码: .radio{ display: inline-block; position: relative; line-height: 18px; margin-right:

2019.4.25 表格表单与HTML5 && CSS3

无人久伴 提交于 2020-01-09 18:43:42
目录 表格 标签 属性 表格间距离 表格的内边距 表格的边框 样式 边框合并 行合并 列合并 display 表单 标签 属性 提交的网址 请求方式 input相关 扩大响应范围 字符 密码 单选框 name value 默认选中 多选框 文件上传 下拉列表 可拖拽大文本输入框 表单提交 表单重写 数字 邮箱 链接 颜色 时间 滑动条 搜索框清除 隐藏效果 HTML5 && CSS3 H5中新增的标签 音频标签 视频标签 nav header section main aside canvas H5中新增的选择器 属性选择器 结构选择器 伪类选择器 过渡 变换 平移 缩放 旋转 倾斜 动画 代码 样式 动画库的使用 阴影 文字阴影 盒子阴影 怪异盒模型 线性渐变 径向渐变 @ 表格 标签 表格 table 行 tr 列 td 表头 th 属性 表格间距离 cellspacing <table cellspaceing = "10 "> 表格的内边距 cellpadding <table cellpadding = "20"> 表格的边框 border <table border = "3"> 样式 边框合并 border-collapse: collapse; 行合并 <td rowspan = "2"> 列合并 <td colspan = "2"> display

jQuery Validation Engine 表单验证

大兔子大兔子 提交于 2020-01-09 09:29:32
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 中文汉化版,官方只有英文的。同时根据中国国情修改了部分验证规则。 这个插件支持大部分的浏览器,但由于有使用到了css3的阴影和圆角样式,所以在IE浏览器下无法看到圆角和阴影效果(万恶的IE)。 官方下载地址: http://www.position-absolute.com/articles/jquery-form-validator-because-form-validation-is-a-mess/ 普通验证的例子: http://www.position-relative.net/creation/formValidator/ ajax验证的例子: http://www.position-relative.net/creation/formValidator/demoSubmit.html 一:简单说明下使用教程: 引入jquery和插件js、css <link rel="stylesheet" href="css/validationEngine.jquery.css" type="text/css" media="screen" charset="utf-8" /> <script src="js/jquery.js" type="text/javascript"></script> <script