checkbox

How to change the background color on a input checkbox with css? [duplicate]

偶尔善良 提交于 2019-12-17 06:34:31
问题 This question already has answers here : How to style a checkbox using CSS (31 answers) CSS ''background-color" attribute not working on checkbox inside <div> (8 answers) Closed 3 years ago . Hello Friends all I'm trying to do is change the background color of a checkbox. I tired many things but nothing works. Can some one help? input[type="checkbox"] { background: #3d404e; border: #7f83a2 1px solid; } 回答1: I always use pseudo elements :before and :after for changing the appearance of

Checking off pdf checkbox with itextsharp

梦想的初衷 提交于 2019-12-17 05:06:47
问题 I've tried so many different ways, but I can't get the check box to be checked! Here's what I've tried: var reader = new iTextSharp.text.pdf.PdfReader(originalFormLocation); using (var stamper = new iTextSharp.text.pdf.PdfStamper(reader,ms)) { var formFields = stamper.AcroFields; formFields.SetField("IsNo", "1"); formFields.SetField("IsNo", "true"); formFields.SetField("IsNo", "On"); } None of them work. Any ideas? 回答1: You shouldn't "guess" for the possible values. You need to use a value

How do I see which checkbox is checked?

北战南征 提交于 2019-12-17 05:05:59
问题 How do I check in PHP whether a checkbox is checked or not? 回答1: If the checkbox is checked, then the checkbox's value will be passed. Otherwise, the field is not passed in the HTTP post. if (isset($_POST['mycheckbox'])) { echo "checked!"; } 回答2: you can check that by either isset() or empty() (its check explicit isset) weather check box is checked or not for example <input type='checkbox' name='Mary' value='2' id='checkbox' /> here you can check by if (isset($_POST['Mary'])) { echo "checked!

Change icons of checked and unchecked for Checkbox for Android

China☆狼群 提交于 2019-12-17 04:22:47
问题 Instead of having a check mark for the icon, I want a custom star (I have checked and unchecked icons). Can this be done through a property? Or must I declare a custom widget that derives from Checkbox? 回答1: Kind of a mix: Set it in your layout file :- <CheckBox android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="new checkbox" android:background="@drawable/checkbox_background" android:button="@drawable/checkbox" /> where the @drawable/checkbox will look like

How to show android checkbox at right side?

柔情痞子 提交于 2019-12-17 04:15:29
问题 By default android checkbox shows text at right side and checkbox at left I want to show checkbox at right side with text at left how do I achieve this? 回答1: I can't think of a way with the styling, but you could just set the text of the checkbox to nothing, and put a TextView to the left of the checkbox with your desired text. 回答2: I think it's too late to answer this question, but actually there is a way to achieve your goal. You just need to add the following line to your checkbox: android

How to get all checked items from a ListView?

懵懂的女人 提交于 2019-12-17 03:36:22
问题 I've a couple of question I haven't been able to figure out. I'm trying to get all the checked elements from a ListView but: If I check and then uncheck an element, it's returned as "checked" by the getCheckedItemPositions() function I don't know how can I iterate through this: SparseBooleanArray checked = list.getCheckedItemPositions(); 回答1: The other answers using SparseBooleanArray are nearly correct, but they are missing one important thing: SparseBooleanArray.size() will sometimes only

Testing if a checkbox is checked with jQuery

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-17 02:52:10
问题 If the checkbox is checked, then I only need to get the value as 1; otherwise, I need to get it as 0. How do I do this using jQuery? $("#ans").val() will always give me one right in this case: <input type="checkbox" id="ans" value="1" /> 回答1: Use .is(':checked') to determine whether or not it's checked, and then set your value accordingly. More information here. 回答2: $("#ans").attr('checked') will tell you if it's checked. You can also use a second parameter true/false to check/uncheck the

JQGRID - maintain check box selection state - page refresh / redirect / reload

邮差的信 提交于 2019-12-17 02:26:53
问题 H ow to maintain the checkbox selection after the page refresh / reload / redirected from some other page in JQGRID . I am working in aspx pages. I am able to maintain the checkbox selection state in paging using following code: gridComplete: function () { var currentPage = $(this).getGridParam('page').toString(); //retrieve any previously stored rows for this page and re-select them var retrieveSelectedRows = $(this).data(currentPage); if (retrieveSelectedRows) { $.each(retrieveSelectedRows,

How to stop event bubbling on checkbox click

拜拜、爱过 提交于 2019-12-17 01:40:16
问题 I have a checkbox that I want to perform some Ajax action on the click event, however the checkbox is also inside a container with it's own click behaviour that I don't want to run when the checkbox is clicked. This sample illustrates what I want to do: $(document).ready(function() { $('#container').addClass('hidden'); $('#header').click(function() { if ($('#container').hasClass('hidden')) { $('#container').removeClass('hidden'); } else { $('#container').addClass('hidden'); } }); $('#header

How to stop event bubbling on checkbox click

有些话、适合烂在心里 提交于 2019-12-17 01:40:04
问题 I have a checkbox that I want to perform some Ajax action on the click event, however the checkbox is also inside a container with it's own click behaviour that I don't want to run when the checkbox is clicked. This sample illustrates what I want to do: $(document).ready(function() { $('#container').addClass('hidden'); $('#header').click(function() { if ($('#container').hasClass('hidden')) { $('#container').removeClass('hidden'); } else { $('#container').addClass('hidden'); } }); $('#header