checkbox

styled checkboxes overlap in table

余生长醉 提交于 2019-12-13 05:01:44
问题 I got this snippet from another question here on stackoverflow: Snippet If I put these checkboxes in a table, one checkbox per row, they overlap due to the padding of the labels. Why does this happen? Why doesn't the table cells change their height? And how can I fix it? Also, 'width: 100%' does not work for the label 回答1: Try tr { display:block; margin:10px 0px; } Or without adding table styles label{ display: block; } Also, I made a codepen here 来源: https://stackoverflow.com/questions

run a function after checkbox checked and pushed submit button with jquery

允我心安 提交于 2019-12-13 04:57:22
问题 i'm trying to run a function after checkbox checked and pushed submit button with jquery this is what i have: <form name="select"> <label for="Genre"><input type="checkbox" checked="checked" id="Genre">Genre</label> <input type="button" onclick="myFunction()" value="submit"> </form> this is my function: function myFunction() { $("input [id=Genre] [checked]").each( function() { alert("genre is checked"); } ); } any ideas what i'm doing wrong? 回答1: If you select by ID you can just use: $('

Reference previous object created in loop to update SQL

别说谁变了你拦得住时间么 提交于 2019-12-13 04:56:00
问题 I have a loop that sets up the form, which is the following code (in the form load event). This displays a checkbox with the persons name. It checks the checkbox if a bit field is 1. int xAxisCheckbox = 130; int yAxisCheckbox = 30; for (int i = 0; i < selectDS.Tables[0].Rows.Count; i++) { this.myCheckBox = new CheckBox(); myCheckBox.Location = new Point(xAxisCheckbox, yAxisCheckbox); myCheckBox.Size = new Size(120, 20); myCheckBox.Text = selectDS.Tables[0].Rows[i]["FullName"].ToString();

Core-Data Check Box Cell with many-to-many data

*爱你&永不变心* 提交于 2019-12-13 04:47:47
问题 i've got a Core-Data model like this (just an example): Now i'd like to have a window where a user can select the ingredients of the drink from every ingredient. like this: How can i achieve this? Thanks, Thomas Günzel 来源: https://stackoverflow.com/questions/12372874/core-data-check-box-cell-with-many-to-many-data

jQuery Validation Plugin - Checkboxes

不打扰是莪最后的温柔 提交于 2019-12-13 04:46:26
问题 I am auto generating a quiz page with single choice, multi choice and user input types of questions. In order to ensure all questions have been answered, I am using the jQuery Validation Plugin. This is working well for Radiobuttons and Textboxes, but fails when encountering checkboxes. My form (dynamically generated by taking questions and choices from MySQL) code is generated as below : <script> $(document).ready(function () { $("#form1").validate({ invalidHandler: function() { alert(

how to save check box values of custom list view using shared preferences

半世苍凉 提交于 2019-12-13 04:46:08
问题 i am trying to make launcher. i have have displayed the custom list with app_label,icon,package_name and check box. now i want to save selected app_name in shared preferences. i m not getting how to go through it. kindly help. here is my code: adapter = new ArrayAdapter<AppDetail>(MainActivity.this, android.R.layout.simple_list_item_multiple_choice, apps) { @Override public View getView(int position, View convertView, ViewGroup parent) { View row = convertView; if (row == null) { convertView

How to insert 1 or 0 in Sql Server for bit type field if checkbox is checked?

瘦欲@ 提交于 2019-12-13 04:38:25
问题 I am trying to insert 1 or 0 in my SQL Server Database, and my data type is "bit". I have tried doing this but it says incorrect syntax near where- dt=g1.ExecDB( insert into tbl ("check1,check2,check3") values('" + Convert.ToByte(check1.Checked) + "','" + Convert.ToByte(check2.Checked) + "','" + Convert.ToByte(check3.Checked) + "' ) ) where loginname = '"+Session["log"].ToString() + "'" ) ; Please Guide me where I am doing wrong? 回答1: Adding the name of your checkboxes inside the sql string

How to clear a textbox based on a checkbox using Javascript

一笑奈何 提交于 2019-12-13 04:37:39
问题 I am trying to code in javascript (to avoid validation triggers at the server) to clear a text box if the checkbox associated with it is unchecked. I have this code ... <input type="checkbox" id="chkOTHER" onclick="document.getElementById('txtOtherFlag').value='';" /> <asp:TextBox ID="txtOtherFlag" runat="server" AutoPostBack="True" CausesValidation="True" ValidationGroup="ValidationGroup1"></asp:TextBox> The problem is the Javascript inside the checkbox is not triggering to remove the value

Get CheckboxGroup (or RadioGroup) values [EXTJS 3.4]

*爱你&永不变心* 提交于 2019-12-13 04:37:10
问题 I have a checkboxgroup and a radiogroup. For both of them, I want to catch several values. For the checkboxGroup var DescCheck = new Ext.form.CheckboxGroup({ fieldLabel: 'Description of service : <span style="color: rgb(255, 0, 0); padding-left: 2px;">*</span>', width : 540, labelSeparator : '', items: [ {boxLabel: 'Direct', name: 'Direct', inputValue: 'Direct'}, {boxLabel: 'Fixed-day', name: 'day', inputValue: 'Fixed'}, {boxLabel: 'Weekly', name: 'Weekly', inputValue: 'Weekly'} ] }); I tried

Radio-button act like checkbox

旧城冷巷雨未停 提交于 2019-12-13 04:32:25
问题 Here is my code: HTML: <label><input type="radio" name="radio"> Checkbox 1</label> <label><input type="radio" name="radio"> Checkbox 2</label> JavaScript: $(document).ready(function(){ $(":radio").behaveLikeCheckbox(); }); JSFiddle. I got the code from here. My problem is that I can't make it work. Can someone help? 回答1: You have to include jQuery and the behaveLikeCheckbox plugin to make this work. Here is an updated fiddle: http://jsfiddle.net/mq8Zq/174/ So in your HTML document: <label>