checkbox

JQuery Checkbox list problem in IE? Values saved as on,on,on should be 10,12,13 etc

被刻印的时光 ゝ 提交于 2019-12-31 03:08:18
问题 I've a list of checkboxes that get rendered out using javascript. <input type="checkbox" name="sportType" id="sportType11" value="11" />Golf <input type="checkbox" name="sportType" id="sportType12" value="12" />Tennis <input type="checkbox" name="sportType" id="sportType13" value="13" />Football <input type="checkbox" name="sportType" id="sportType14" value="14" />Cricket On submitting the form I can pickup the selected values in ASP.NET by using: Request.Form["sportType"] In firefox this

Accessing ListView CheckBox in Android

人走茶凉 提交于 2019-12-31 03:07:06
问题 I'm making a to-do list app in android. Everything is working well enough except I have checkboxes in a ListView that I cannot set programmatically. I'm using a SQLite database that stores my tasks and whether or not they have been marked as complete. When I check a checkbox, it successfully saves a "1" in my database. I have an updateUI method that reads the text of my tasks from my database and displays it. I have made a new "updateUICheckBox" method to handle updating the UI for the

Javascript toggle checkbox

夙愿已清 提交于 2019-12-31 03:06:07
问题 I need to toggle all buttons with a single function. Function needs to toggle all checkboxes in the document as my checkboxes are freestanding and not part of a form. I currently have this, but it is not working properly. I get syntax error: syntax error in my firefox console. checked=false; function checkedAll() { var c = new Array(); c = doc.getElementsByTagName('input'); if (checked == false){ checked = true; }else{ checked = false; } for (var i = 0; i < c.length; i++){ if (c[i].type ==

Enter Key simulate click not working for checkboxes

可紊 提交于 2019-12-31 02:42:08
问题 I have copied and slightly modified the code found at the bottom of this post to allow tabbing between form controls on a worksheet form I have created. Here is the segment relating to the KeyCode = vbKeyEnter: Select Case KeyCode Case vbKeyTab Dim Backward As Boolean Backward = (Shift And fmShiftMask) Call MoveFocus(Cntrl:=Cntrl, TabIndex:=TabIndex, Backward:=Backward) Case vbKeyEnter Select Case TypeName(Cntrl) Case TxtBoxType If Not (Cntrl.EnterKeyBehavior And Cntrl.MultiLine) Then Call

How do I prevent default checkbox event from overriding my jQuery check/uncheck function?

依然范特西╮ 提交于 2019-12-30 18:32:43
问题 I have a list of checkboxes inside a table with a simple jQuery function that allows the user to click anywhere in the table row to check/uncheck the checkbox. It works great, except when the user actually clicks on the checkbox. It doesn't work then. Any ideas? Here is my code: HTML: <tr onClick="checkBox()">...</tr> jQuery: function checkBox() { var ischecked = $('input#myContacts').attr("checked"); if(ischecked) { $('input#myContacts').attr("checked", false); } else { $('input#myContacts')

Set radio button 'checked' in jquery based on ID

天大地大妈咪最大 提交于 2019-12-30 17:27:21
问题 I have two radio buttons with the same name, one is checked by default. How can you check or uncheck a radio button in jQuery when selecting from id? I've tried: $('#radio1').attr('checked','checked'); $('#radio1').attr('checked', true); Nothing seems to work.. any ideas? Thank you! 回答1: You can not have same id ( #radio1 ) more than once, use a class instead. $('.radio1').attr('checked', true); $('.radio2').attr('checked', true); The id should be used once per element per page. If you want

Set radio button 'checked' in jquery based on ID

孤街浪徒 提交于 2019-12-30 17:27:16
问题 I have two radio buttons with the same name, one is checked by default. How can you check or uncheck a radio button in jQuery when selecting from id? I've tried: $('#radio1').attr('checked','checked'); $('#radio1').attr('checked', true); Nothing seems to work.. any ideas? Thank you! 回答1: You can not have same id ( #radio1 ) more than once, use a class instead. $('.radio1').attr('checked', true); $('.radio2').attr('checked', true); The id should be used once per element per page. If you want

Re-populate checkbox if it fails in validation in an edit form in Codeigniter

倖福魔咒の 提交于 2019-12-30 15:02:03
问题 I works on the an data-edit form in codeigintier. And the problem is about re-populate checkbox It works if it is an add form (that means I need not concern about the value in database): <?= set_checkbox('is_default', '1'); ?> for checkbox The problem is, in the edit form: I can't repopulate the checkbox <?php if ($customer_group[0]['is_default'] == "1") echo "checked"; set_checkbox('is_default', '1'); ?> The checkbox will check even I have not check it in the edit => fail to validate in the

making checkboxes behave like radio buttons

谁说我不能喝 提交于 2019-12-30 12:08:45
问题 Please see this: http://gisdev.clemson.edu/fireflies Toward the top right are three checkboxes and I am trying to make them work like radio buttons. Part of the programming is working but here is something which is problematic: Initially, the 'Counties' checkbox is checked. And if I were to click on the 'Hydric Soil Rating' checkbox and then click back on the Counties checkbox the Hydric checkbox still stays checked. The console doesn't output anything, meaning the value of checkboxes

How to get the checkbox value from a dynamically generated checkbox list in asp.net

对着背影说爱祢 提交于 2019-12-30 11:17:12
问题 Within a web form I am dynamically creating a series of chekboxes that are added to an asp:placeholder //Generates the List of Entities that may be shared protected void GenerateEntityList(string agencyId, string agencyName) { var selectedAgency = UserFactory.GetAgencyAndSharedDataById(Convert.ToInt64(agencyId)); entityContainer.Controls.Clear(); //builds the entity list based upon entities in DB var currentEntities = UserFactory.GetEntityList(); //add checkboxes entityContainer.Controls.Add