w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
I've created a php function that builds 7 check boxes, 7 product drop down boxes and 7 quantity boxes which pertain to each prouduct.
For checkboxes you use checked="checked" or just checked And for dropdowns you use selected="selected" or just selected <select> <option value="volvo">Volvo</option> <option value="saab">Saab</option> <option value="vw">VW</option> <option value="audi" selected>Audi</option> </select> Example here

Categories : PHP

One page check out Magento boxes greyed out - registered customers can't check out
Thanks Liyakat. My developer has looked at it and fixed it. In Europe it seemed to work fine, it was just the Australian shop that was playing up. This is the thread he used to fix it: http://www.magentocommerce.com/boards/viewthread/55232/P15/ Hope this will help others too!

Categories : Magento

select/deselect all check boxes on click a single check box by javascript
With jQuery 1.6+, you can do $('.check-all').click(function () { var checked = this.prop('checked'); this.closest('table').find(':checkbox').prop('checked', checked); } where check-all is a class that the two "select/unselect all" checkboxes have.

Categories : Javascript

How do I check all check boxes in a Kendo UI TreeView (parents and children nodes) based on a button click?
Figured out how to do it: var treeView = $("#treeview").data("kendoTreeView"); var userId = $('#user_id').val(); $('#treeview').find('input:checkbox:checked').each(function() { ...

Categories : Misc

Checking all check boxes when main check box is clicked
The reason it only works once is because you should have used prop(), not attr(). prop() changes the property, as in element.checked, while attr() changes the attribute, as in <input type="radio" checked="checked" />, and changing the attribute does not change the property, which is essentially what you want, as changing the attribute will only work once because the next time the property is checked it comes back the opposite of the attribute. See this SO question for an overview of the difference between prop and attr. $('#allcb').click(function(){ if ($('#allcb').is(':checked')) { $('.chk').each(function(){ $(this).prop('checked', true); }); } else { $('.chk').each(function(){ $(this).prop('checked', false); })

Categories : Jquery

Best way to check a lot of check boxes in a checkboard game
It'll depend a lot on how you're representing your matrix... If I understood your problem, the easiest way is to simply make a loop, and for each row, count the number of checks checked. So: for each row: if col1 = is checked, check++ if col2 = is checked, check++ if col3 = is checked, check++ if check > 1 tell the user that there is an error. end for If you change your matrix to store a 0 value for unchecked and 1 for checked, you could test it like: for each row: if col1 + col2 + col3 > 1 tell the user that there is an error end for

Categories : C++

check all and uncheck all check boxes
what do you expect !$checkbox.attr('checked') to return? Because $checkbox.attr('checked') returns 'checked' or nothing. You should use prop not attr for this as it's truey/falsy $('document').ready(function(){ $("#btn").on("click", function () { var $checkbox = $(".checkBoxClass"); $checkbox.prop('checked', !$checkbox.prop('checked')); }); }); so now !$checkbox.prop('checked') returns true or false which you can legitimately call ! against

Categories : Jquery

check all check boxes only in one table
You're passing the checkbox as me, so if you use that to find the closest table, it should work : checkBoxes = function (me) { $(me).closest("table").find('input[type="checkbox"]').not(me).prop('checked', me.checked); } FIDDLE

Categories : Javascript

How do i check for a change in a file that has been included in an HTML doc through an AJAX script?
Doing this with PHP can be a bit cumbersome. You could try doing something like long polling where you keep the HTTP request open until the server has new data to send to the user. If messages are sent frequently, this might not be ideal. You might want to consider using event-driven web technologies like node.js with something like Socket.IO. In any case, you'll likely want to maintain a connection with the server if you want to get the message in near real-time. There are ways to use WebSockets with PHP as well, but PHP isn't really the best for this because it's not designed to keep scripts running for long periods (also see What exactly entails setting up a PHP Websocket Server?).

Categories : PHP

Asp.net Treeview with check boxes
I would suggest you to append your child node value along with parent node value so when you're going to bind gridview based on user selection, it would be easy for you. Check out below link that shows how to check parent-child node: http://nilthakkar.blogspot.in/2009/04/check-uncheck-treeview-checkboxes-with_13.html You can have valued of checked nodes of treeview with Checkednodes property of treeview. Check out following link that shows how to do it. http://nilthakkar.blogspot.in/2009/05/retrieve-selected-treenode-value-at.html

Categories : C#

Wants to get Check boxes with labels
You comment, "renderComponent.setText("Hello") is giving only last value." Verify that your TableModel has individual storage for each row's check box state and label value. In this example, the class Value holds the relevant data: private static class Value implements Comparable<Value> { private Boolean selected; private Double value; … } The corresponding TableModel manages a List<Value> and the required renderer and editor use the data from each Value instance accordingly. As an aside, Value implements the Comparable interface for convenience in sorting.

Categories : Java

Setting check boxes on JSP
<input type="checkbox" path="asMuchAsPossible" name="asMuchAsPossible" id="asMuchAsPossible" <c:if test="${goalDetailCommand.asMuchAsPossible}">checked</c:if>/> Would work, although it doesn't seem very elegant...

Categories : Jsp

two check boxes that are interdependent
Try if($("#checkbox1 input:checked") && $("#checkbox2 input:checked")){ -- } else if($("#checkbox1 input:checked"){ --- } else if($("#checkbox2 input:checked"){ --- }else{ -------------nothing checked }

Categories : Jquery

Check boxes search with Ransack gem
I'm not familiar with meta search but in Ransack (in Rails 4) you can use something like this: MODELS: class User < ActiveRecord::Base has_many :user_vehicles has_many :vehicles, through: :user_vehicles end class UserVehicle < ActiveRecord::Base belongs_to :user belongs_to :vehicle end class Vehicle < ActiveRecord::Base has_many :user_vehicles end Controller: class UsersController < ApplicationController def index @q = User.search(params[:q]) @users = @q.result(distinct: true) end end View: <%= search_form_for @q , url: users_path, :html => { class: 'your-class' } do |f| %> <% Vehicle.all.each do |vehicle| %> <%= check_box_tag('q[vehicles_id_eq_any][]', vehicle.id ) %> <%= vehicle.name %> <% end %&

Categories : Ruby On Rails

For loop on multiple check boxes
Try using FindControl like this if you have id of controls like Checkbox1,Checkbox3 etc. for (int i = 1; i < 12; i+=2) { CheckBox cb = (CheckBox)Page.FindControl("Checkbox" + i); cb.Enabled = false; }

Categories : C#

Adding check boxes to an advancedDataGrid
In MXML section <mx:DataGridColumn textAlign="center" width="25"> <mx:headerRenderer> <fx:Component> <mx:CheckBox change="{outerDocument.fnChangeAll(chkAll)}" id="chkAll" selected="{data.flRead}" /> </fx:Component> </mx:headerRenderer> </mx:DataGridColumn> In ActionScript code public function fnChangeAll(chk:Object):void { var check:CheckBox= chk as CheckBox; for each (var curr:ObjectOfDataProvider in listObject) { curr.flRead=check.selected; } } (is the same thing with AdvancedDataGrid) Summarizing: You must add an headerRenderer linked on your column, so you write a function about behaviour of your header. Tell me if it's OK

Categories : Actionscript

Get control name of check boxes in checklistbox?
I believe you can refer to the clbCheckedListBox.ID property to get the unique id of a control. There also the UniqueID property and TagName that could interest you. The fact that you .Cast(Of String)() might be a problem here has it would require the full cehckbox object to perform what is am suggesting

Categories : Vb.Net

Switch on the id of check boxes in javascript don't work?
function handleCheckBoxEvent(cb){ var index = 0; switch (cb.id){ case "cb0": index = 0; alert(cb.id); break; case**:** "cb1": index = 1; alert(cb.id); break; } } You got an extra ":" in the second case, probaly remove it and i should be fine. Tested it and after removing the unnessercary ":" it works.

Categories : Javascript

Check boxes goes to checked automatically in Android
If you know the items to be checked or unchecked before starting then just set it to the adapter that you are using like this if (checkBoxState.contains(categories.get(position).categoryid)) { holder.checkbox.setChecked(true); } else { holder.checkbox.setChecked(false); } Then continue the code like this holder.checkbox .setOnCheckedChangeListener(new OnCheckedChangeListener() { public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { if (isChecked) { checkBoxState.add(categories.get(position).categoryid); } else { checkBoxState.remove(categories.get(position).categoryid)

Categories : Android

Simple mailing form with check boxes
action="mailto:?subject=Hello" This is not what you think it is. action specifies the destination URL. mailto: links are sent to the client, the server doesn't do anything with them. Ex: "mailto:mr.smith@matrix.com" "http://www.domain.com" mailto is like http here. To send mail using PHP you can the mail function or some other implementation. The action in your form will have to point to a script on your server.

Categories : PHP

Create nested resources from check boxes
I think the method you are looking for is collection_check_boxes. Check it out in the documentation.

Categories : Ruby On Rails

Many Check boxes toggle show/hide
I've created a fiddle demoing what I think you're trying to accomplish. As I understand it, you want to loop through all of the checkboxes to determine if any of them are checked. If any of them are checked, both text boxes are required. It'd be more efficient to set the display value for both "required" messages simultaneously instead of running showReq for each. Here's the method I added, called within showReq to determine if any checkboxes are checked. function checkboxesChecked() { //get all the checkboxes var checkboxes = document.getElementsByName('non_standard_software'); //loop through checkboxes, if any are checked, return true for (var i = 0; i < checkboxes.length; i++) if (checkboxes[i].checked) return true; return false; }

Categories : Javascript

Issue in assigning dynamic ids to check boxes
The id attribute is evaluated during view build time, but the <ui:repeat> runs during view render time. Essentially, your IDs end up being null which is indeed invalid. Just don't try to manually assign generate IDs. The <ui:repeat> will already automatically insert the current iteration index in the client ID. This example, <h:form id="formId"> <ui:repeat ...> <h:outputLabel for="checkboxId" ... /> <h:selectBooleanCheckBox id="checkboxId" ... /> </ui:repeat> </h:form> will end up like <form id="formId"> <label for="formId:0:checkboxId">...</label> <input type="checkbox" id="formId:0:checkboxId" /> <label for="formId:1:checkboxId">...</label> <input type="

Categories : JSF

validate of check boxes in oracle apex
In APEX, there is no need for 4 checkboxes. Create 1 checkbox that uses an LOV. This isn't a validation either, simply create a Dynamic Action with the following properties: Main Properties Event: Change Selection Type: Item(s) Item: [P1_CHECKBOX] Condition: Equal to Value: OTHERS TRUE ACTION Action: Show Fire when Result is: True Fire on page load: Yes Selection Type: Item(s) Item: [P1_TEXT] FALSE ACTION Action: Hide Fire when Result is: False Fire on page load: Yes Selection Type: Item(s) Item: [P1_TEXT]

Categories : Misc

How can I select and unselect check boxes in Winform?
Add below event to all other checkboxes except chckAll private void checkBox_CheckedChanged(object sender, EventArgs e) { CheckFlg = true; if (!CheckAllFlg) { chckAll.Checked = checkBoxesPanel3.Controls.OfType<CheckBox>().Where(x => x.Name != "chckAll").All(c => c.Checked); } CheckFlg = false; } private void chckAll_CheckedChanged(object sender, EventArgs e) { CheckAllFlg = true; if (!CheckFlg) { foreach (CheckBox ctrl in checkBoxesPanel3.Controls.OfType<CheckBox>().Where(x => x.Name != "chckAll")) { ctrl.Checked = chckAll.Checked; } } CheckAllFlg = false; } You need to define two property as below public partial class Form1 { public bool CheckAllFlg { get; set; } publ

Categories : C#

How to return selected check boxes using wxPython?
Save checkboxes for later uses. I used self.cb_list in the following code. import wx class MyCheckBox(wx.Frame): def __init__(self, parent, id, title): wx.Frame.__init__(self, parent, id, 'Checking Options', size=(470, 400)) panel = wx.Panel(self, -1) self.cb_list = [] for pos in [(120,75), (200,75), (278,75), (356,75), (120,105), (200,105), (278,105), (356,105)]: cb = wx.CheckBox(panel, -1, '', pos) cb.SetValue(False) self.cb_list.append(cb) wx.StaticText(panel, -1, "Send output to File", (70, 255)) self.cb = wx.CheckBox(panel, -1, '', (50, 255)) self.cb.SetValue(True) wx.EVT_CHECKBOX(self, self.cb.GetId(), self.ShowTitle) self.btnSelect = wx.Button(panel, label="Select Al

Categories : Python

Select check boxes in gridview using jquery
if you want to write your own jquery bit to handle this, you can do: // select your 'all' checkbox $('input.all').on('click', function(){ $('input[type="checkbox"]').prop('checked', this.checked); });

Categories : C#

Toggle between 2 check boxes using jquery or javascript
<html> <body> <form name=f1 id=f1> <input type=checkbox name=chk1 id=chk1 onclick=javascript:document.f1.chk2.checked=!document.f1.chk1.checked;> Check 1<BR> <input type=checkbox name=chk2 id=chk2 onclick=javascript:document.f1.chk1.checked=!document.f1.chk2.checked;> Check 2<BR> </form> </body> </html>

Categories : Javascript

Check boxes hidden unless a drop down value is selected
You seem to be missing the id defined on the select box. Place the javascript inside a function and into a js file and store it in the same directory that you find the application.js file. Similar to the following: function your_new_method(){ $("#cat_selector").change(function(){ if($("#cat_selector").val() == "Shopping"){ $(".hidden_option").fadeIn('fast'); } }; } Inside application.js there should be a method like the following. If it doesnt exist you can just add it. $(document).ready(function(){ your_new_method(); //Calls the method you created to set up the unobtrusive js });

Categories : Javascript

Appending text-box while checking check-boxes in jQuery.
I added id to your appended textarea in order to be able to know if their exists or not. var newtextbox = '<input id="textarea_'+classname+'" type="text" value="' + parent + '"/>'; And for vice versa, I used remove jquery method. $("#textarea_"+classname).remove(); Can you check this fiddle ? DEMO

Categories : Javascript

Writing code that applies to multiple check boxes in VBA
Put this in a class moduled named clsCheckBoxHandler Public WithEvents chk As MSForms.CheckBox Private Sub chk_Click() MsgBox chk.Caption & " Clicked!" End Sub then in the Userform Dim chkCollection As Collection Private Sub UserForm_Initialize() Dim cCont As Control Dim chkH As clsCheckBoxHandler Set chkCollection = New Collection For Each cCont In Me.Controls If TypeName(cCont) = "CheckBox" Then Set chkH = New clsCheckBoxHandler Set chkH.chk = cCont chkCollection.Add chkH End If Next cCont End Sub this is just a simple handler for checkboxes that has a click event but can be extended to cover multiple controls and events.

Categories : Vba

generate check-boxes based on drop-down selection?
try this: $.getJSON('/clients/client_contacts/' + state, function(data){ console.log(data); data.each(function(){ var id = data.id; var name = data.firstName; //add to new div with id myDiv $('#myDiv').append('<input name='+ id +' type="checkbox" /> ' + name + '<br />');) }); });

Categories : HTML

Check Boxes not able to be Selected -- They are Editable! Java Swing
There are a number of things that jump out... (As has already begin pointed out) getValueAt appears to be declared wrong. It should be returning Object. Think about it for a second. Your expectation is that the first column will be boolean, so how can you return String from this method...which leads to... Your data array is an array of String...where, again, the expectation is that the first value should be boolean. Now you can actually keep this, but you will need to translate the value to boolean from the getValueAt method and back again for the setValueAt method...which leads to... You've not implemented setValueAt, so there is no way that the changes to the cell value can be stored You're also not implementing getRowCount, which is required, getColumnCount, which is required and

Categories : Java

How to dynamically create check boxes or buttons in Wxpython?
Checkbox class -> http://wxpython.org/docs/api/wx.CheckBox-class.html Button class -> http://wxpython.org/docs/api/wx.Button-class.html Example code for checkbox: #!/usr/bin/python # -*- coding: utf-8 -*- import wx class Example(wx.Frame): def __init__(self, *args, **kw): super(Example, self).__init__(*args, **kw) self.InitUI() def InitUI(self): pnl = wx.Panel(self) cb = wx.CheckBox(pnl, label='Show title', pos=(20, 20)) cb.SetValue(True) cb.Bind(wx.EVT_CHECKBOX, self.ShowOrHideTitle) self.SetSize((250, 170)) self.SetTitle('wx.CheckBox') self.Centre() self.Show(True) def ShowOrHideTitle(self, e): sender = e.GetEventObject() isChecked = sender.GetValue() if isChecked: self.SetTitle('wx.CheckBox') else:

Categories : Python

Selecting multiple check boxes in a group using jQuery
By example, for the value 8 : <input type="checkbox" class="chk" name="myGroup[]" value="7" /> <input type="checkbox" class="chk" name="myGroup[]" value="8" /> <script> $(".chk[value='8']").prop("checked", true); </script>

Categories : Javascript

Django target individual check boxes in template
I recommend writing your own subclass of the CheckboxSelectMultiple widget to do this, overriding its render method. The rendering code is pretty straightforward, but that widget returns the entire <ul> element with the checkboxes pre-rendered - trying to pull out the representations of the individual checkboxes in a template is going to be tricky at best. Something like this: class ImageCheckboxSelectMultiple(CheckboxSelectMultiple): def render(self, name, value, attrs=None, choices=()): if value is None: value = [] has_id = attrs and 'id' in attrs final_attrs = self.build_attrs(attrs, name=name) output = [u'<ul>'] # Normalize to strings str_values = set([force_unicode(v) for v in value]) for i, (option_value, opt

Categories : Django

Two select all check boxes in a page is not working correctly
Basically, by doing $('td input[type=checkbox]').attr('checked', this.checked); You are checking all checkboxes that are in a td cell. You need to improve your selector. You did not show us your html so I can only guide you but you can Give a class to those checkboxes or to their tds. $('td.my_specific_tds input[type=checkbox]').attr('checked', this.checked); Pass a container that contains the checkboxes you want to update. $('td input[type=checkbox]', $('#my_container_id')).attr('checked', this.checked);

Categories : Jquery

Slide boxes with margin-left check if overslided
There are many jQuery plugins for this. First determine how many results there are, then determine how many you want visible, then use another variable to keep track with how many are hidden to the left and how many are hidden to the right. So... var total = TOTAL_RESULTS; var leftScrolled = 0; var rightScrolled = total - 3; // minus 3, since you want 3 displayed at a time. instead of using marginLeft I would wrap all of these inside of a wrapper and set the positions to absolute. Then animate using "left" property or "right". There's a lot of code required to do this, well not MUCH, but since there are many plugins, I think you'd be better off searching jquery.com for a plugin and look for examples on how to do this. marginLeft is just not the way to go, since it can cause many vie

Categories : Javascript

Using radio buttons and check boxes for similar task (Android)
rbHide = (RadioButton)findViewById(R.id.rbHide); rbShow = (RadioButton)findViewById(R.id.rbShow); RadioGroup rg = new RadioGroup(this); rg.addView(rbHide); rg.addView(rbShow); rbHide.setOnCheckedChangeListener(this); rbShow.setOnCheckedChangeListener(this); In your layout xml, rbHide and rbShow is already a child of its parent view. Now you add them to a newly created view without removing them from their parent. You should define the RadioGroup inside the layout xml instead of creating them in code. It should look like this: <RadioGroup android:id="@+id/radioGroup" android:layout_width="wrap_content" android:layout_height="wrap_content" android:checkedButton="@+id/rbHide" > <RadioButton android:id="@+id/rbHide" android:layout_w

Categories : Java

MVC - How to submit two sets of multiple check boxes to controller action?
To do this, you have to render a collection. I will assume you have two collections in your model, one called Courses, and one called Tracks. @for(int i = 0; i < collection.Count(); i++ { // Boolean property indicating value is selected on your Courses view model submodel Html.CheckBoxFor(model => model.Courses[i].CourseSelected); Html.Raw(Model.Courses[i].CourseName); } Then do the same for your Tracks. EDIT; Assuming you have a ViewModel with a List<Course> where Course looks like this: public class Course { public bool CourseSelected {get;set;} public string CourseName {get;set;} } You will have to lookup the course based on the index of the checkbox collection. Thus, if Course[0] is set, you need to get the first course based on position. Y

Categories : HTML



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.