Search Results

Search found 2048 results on 82 pages for 'checkbox'.

Page 8/82 | < Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >

  • CheckBox Web Control Basics in ASP.NET 3.5

    In this second part of a series on basic ways to gather user input in ASP.NET 3.5 we ll cover checkbox web controls. Checkboxes are an appropriate choice in situations where a radio button won t work -- where you want to let a user select more than one choice among a group of options for example.... Download a Free Trial of Windows 7 Reduce Management Costs and Improve Productivity with Windows 7

    Read the article

  • Dynamic Table CheckBoxes not having a "Checked" true value

    - by LuvlyOvipositor
    I have been working on a web app using ASP.NET with the code base as C#. I have a dynamic table that resizes based on a return from a SQL query; with a check box added in the third cell of each row. The checkbox is assigned an ID according to an index and the date. When users hit the submit button, the code is supposed to get a value from each row that is checked. However, when looping through the rows, none of the check boxes ever have a value of true for the Checked property. The ID persists, but the value of the checkbox seems to be lost. Code for adding the Checkboxes: cell = new TableCell(); CheckBox cb = new CheckBox(); cell.ApplyStyle(TS); cb.ID = index.ToString() + " " + lstDate.SelectedItem.Text.ToString(); if (reader["RestartStatus"].ToString() == "0") { cb.Checked = false; cb.Enabled = true; } else { cb.Checked = true; } cell.Controls.Add(cb); The code for getting the checkbox value: for (int i = 0; i < CompTable.Rows.Count; i++) { int t3 = CompTable.Rows[i].Cells[2].Controls.Count; Control temp = null; if (t3 0) { temp = CompTable.Rows[i].Cells[2].Controls[0]; } string t2 = i.ToString() + " " + lstDate.SelectedItem.Text.ToString(); if ( temp != null && ((CheckBox)temp).ID == i.ToString() + " " + lstDate.SelectedItem.Text.ToString()) { //Separated into 2 if statements for debugging purposes //ID is correct, but .Checked is always false (even if all of the boxes are checked) if (((CheckBox)temp).Checked == true) { tlist.Add(CompTable.Rows[i].Cells[0].Text.ToString()); } } }

    Read the article

  • jquery validate check at least one checkbox

    - by Omu
    I have something like this: <form> <input id='roles' name='roles' type='checkbox' value='1' /> <input id='roles' name='roles' type='checkbox' value='2' /> <input id='roles' name='roles' type='checkbox' value='3' /> <input id='roles' name='roles' type='checkbox' value='4' /> <input id='roles' name='roles' type='checkbox' value='5' /> <input type='submit' value='submit' /> <form> I would like to validate that at least one checkbox (roles) should be checked, is it possible with jquery.validate ?

    Read the article

  • Inserting checkbox values

    - by rabeea
    hey i have registration form that has checkboxes along with other fields. i cant insert the selected checkbox values into the data base. i have made one field in the database for storing all checked values. this is the code for checkbox part in the form: Websites, IT and Software Writing and Content <pre><input type="checkbox" name="expertise[]" value="Design and Media"> Design and Media <input type="checkbox" name="expertise[]" value="Data entry and Admin"> Data entry and Admin </pre> <pre><input type="checkbox" name="expertise[]" value="Engineering and Skills"> Engineering and Science <input type="checkbox" name="expertise[]" value="Seles and Marketing"> Sales and Marketing </pre> <pre><input type="checkbox" name="expertise[]" value="Business and Accounting"> Business and Accounting <input type="checkbox" name="expertise[]" value="Others"> Others </pre> and this is the corresponding php code for inserting data $checkusername=mysql_query("SELECT * FROM freelancer WHERE fusername='{$_POST['username']}'"); if (mysql_num_rows($checkusername)==1) { echo "username already exist"; } else { $query = "insert into freelancer(ffname,flname,fgender,femail,fusername,fpwd,fphone,fadd,facc,facc_name,fbank_details,fcity,fcountry,fexpertise,fprofile,fskills,fhourly_rate,fresume) values ('".$_POST['first_name']."','".$_POST['last_name']."','".$_POST['gender']."','".$_POST['email']."','".$_POST['username']."','".$_POST['password']."','".$_POST['phone']."','".$_POST['address']."','".$_POST['acc_num']."','".$_POST['acc_name']."','".$_POST['bank']."','".$_POST['city']."','".$_POST['country']."','".implode(',',$_POST['expertise'])."','".$_POST['profile']."','".$_POST['skills']."','".$_POST['rate']."','".$_POST['resume']."')"; $result = ($query) or die (mysql_error()); this code inserts data for all fields but the checkbox value field remains empty???

    Read the article

  • Nesting Ruby on Rails HAML Checkbox in Label Tag

    - by user1279116
    I have the following code which doesn't work: = form_for(resource, :as => resource_name, :url => session_path(resource_name), :html => { :class => "well" }) do |f| = f.label :email = f.email_field :email = f.label :password = f.password_field :password - if devise_mapping.rememberable? %p = f.label :remember_me, :class => "checkbox" = f.check_box :remember_me, :class => "checkbox" %div= f.submit "Einloggen" = render :partial => "devise/shared/links" It only works in that way, but I need it in one line and not in wto: %p = f.label :remember_me, :class => "checkbox" = f.check_box :remember_me, :class => "checkbox" Please help! I'm really desprate right now. I just want the checkbox nested in the label for the bootsrap form. I searched google and stackoverflow but found nothing UPDATE: I solved it now like this: - if devise_mapping.rememberable? %p %label.checkbox{ :for => "remember_me" } = f.check_box :remember_me, :class => "checkbox" Remember

    Read the article

  • IE problem: keyboard interaction with checkbox

    - by Bobby Eickhoff
    I have an HTML table, and each row has a checkbox for selecting or deselecting its row. Whenever a checkbox changes value, I need to add or remove highlighting to the row and also ensure that the page's submit button is only enabled when at least one row is selected and disabled otherwise. The checkbox event handler is defined by the following function: function getCheckboxCallback() { return function () { var parentRow = getParentRow(this); if (!parentRow) { return; // No parent row found; abort } // Adjust the appearance of the row setSelected(parentRow, this.checked); // Count the number of selected table rows, and disable the submit // button whenever no rows are selected enforceInvariants(); return true; }; } Elsewhere in the same module, the checkboxes are given the event handlers: checkbox.onchange = getCheckboxCallback(); checkbox.onclick = getCheckboxCallback(); // alleged IE fix I'm working in Windows XP, and everything works fine in both Firefox 3 and Opera 9. However, IE 7 does not handle keyboard interaction well (mouse interaction works fine). The problem is that if a checkbox has the focus and I hit the spacebar, the checkbox doesn't get checked -- instead it gets half checked (it has the same shadowed appearance that it would get immediately after a mousedown). I have to press the spacebar a second time to actually check the box. Similarly, it requires two key presses to uncheck it. Oddly enough, if I hold down the spacebar for a few moments, then a single press works as expected. Can anyone explain what is going on here? Is there something I'm doing wrong in the JavaScript code that is causing this behavior? How can I fix this?

    Read the article

  • MVVM-Light EventToCommand Behavior for CheckBox Checked/Unchecked in Silverlight

    - by George Durzi
    I would like to handle the Checked and Unchecked events of a Checkbox control and execute a command in my ViewModel. I wired up an EventTrigger for both the Checked and Unchecked events as follows: <CheckBox x:Name="chkIsExtendedHr" IsChecked="{Binding Schedule.Is24Hour, Mode=TwoWay}"> <i:Interaction.Triggers> <i:EventTrigger EventName="Checked"> <GalaSoft_MvvmLight_Command:EventToCommand CommandParameter="{Binding IsChecked, ElementName=chkIsExtendedHr}" Command="{Binding Path=SetCloseTime, Mode=OneWay}" /> </i:EventTrigger> <i:EventTrigger EventName="Unchecked"> <GalaSoft_MvvmLight_Command:EventToCommand CommandParameter="{Binding IsChecked, ElementName=chkIsExtendedHr}" Command="{Binding Path=SetCloseTime, Mode=OneWay}" /> </i:EventTrigger> </i:Interaction.Triggers> </CheckBox> I defined a RelayCommand in my ViewModel and wired up an action for it: public RelayCommand<Boolean> SetCloseTime{ get; private set; } ... SetCloseTime= new RelayCommand<bool>(ExecuteSetCloseTime); The parameter in the action for the command always resolves to the previous state of the CheckBox, e.g. false when the CheckBox is checked, and true when the CheckBox is unchecked. void ExecuteSetCloseTime(bool isChecked) { if (isChecked) { // do something } } Is this expected behavior? I have a workaround where I have separate triggers (and commands) for the Checked and Unchecked and use a RelayCommand instead of RelayCommand<bool>. Each command executes correctly when the CheckBox is checked and unchecked. Feels a little dirty though - even dirtier than having UI code in my ViewModel :) Thanks

    Read the article

  • Jquery Mobile 1.2 Multiple Checkbox Selection Issue

    - by user1819957
    I'm coding a Jquery Mobile 1.2, Jquery 1.8.2, css, and HTML 5 based app that I need to allow the user to select multiple images and execute a command. The following works if I do NOT use the jquery.mobile-1.2.0.min.js library: CSS Code: .image-checkbox-container input[type="checkbox"]{ display: none; } .image-checkbox-container img{ border: 0; margin: 4px; } HTML: JQuery: $('.image-checkbox-container img').live('click', function(){ if(!$(this).prev('input[type="checkbox"]').prop("checked")){ $(this).prev('input[type="checkbox"]').prop("checked", true); this.style.border = '4px solid #38A'; this.style.margin = '0px'; }else{ $(this).prev('input[type="checkbox"]').prop("checked", false); this.style.border = '0'; this.style.margin = '4px'; } }); As soon as I add in the jquery.mobile-1.2.0.min.js library to the code it does not function correctly anymore. The unchecking/unselecting of the checkboxes does not work. I attempted to use the checkboxradio("refresh") but did not have any luck. Any suggestions would be much appreciated. Thanks

    Read the article

  • Plz Help! How to maintain status of gridview checkbox

    - by Royson
    Hi, On my form on left side i have tree-view with check-boxes and on right side grid-view with check-box column. Treeview shows all folders. if user clicked on treenode their files all displayed in gridview. If user checked some files and selects another node and return back it should display checked files as it is. How do i maintain grid-view checked-box column status..? One more query If i checked specific node it should checked all rows of a gridview.

    Read the article

  • How to deal with array of checkbox values in Ruby 1.9.1?

    - by Ola Tuvesson
    In Ruby 1.9.1 strings are no longer enumerable and string.each is undefined. This causes a problem when parsing values for an array of generated checkboxes since the field value, when submitted, becomes an array of strings. For example: <% for map in Map.find(:all) %> <%= check_box_tag "listing[map_ids][]", map.id %> <%= map.title %> <% end %> This will result in an error, undefined method `each' for "1":String, in process_parameter_filter because map_ids is being passed as "map_ids"=["1","2"] (if checkboxes with values 1 and 2 have been checked that is). What is the recommended way to fix this?

    Read the article

  • How does struts 1.X ActionForm handle pure html checkbox list?

    - by BlueDolphin
    I am dealing with an old application which uses struts 1.2. And for some reason, we are using pure html form to submit to struts action. For example: for the content output of testAction.do, I try to submit to itself. item 1 item 2 Then I associate an form bean TestForm with testAction. I am not sure how to specify the properties in the form so that it take the value from myitem1 after user click "submit" I tried to add getMyitem1(), setMyitem1(String[] items), getSelectedMyitem1(), setSelectedMyitem1(String[] items) Those set methods are only called when page are loaded. I guess my understanding of ActionForm in struts 1.x must be wrong. Please advise, thanks.

    Read the article

  • how do I get all checkbox variables even if not checked from HTML to PHP?

    - by netrox
    I noticed that PHP seems to return only values of checked checkboxes. I would like to see a list of checkboxes, not just values of checked checkboxes. Is there a way to detect variables of unchecked boxes? I asked because I want to be able to update settings. For example, I have a few options that are already checked but if an user decides to uncheck an option, I need to know that unchecked value so I can update the option to be disabled.

    Read the article

  • how to put a value to an array when a checkbox is checked? c#?

    - by Jan Darren Noroña
    I am making a random character generator, i have 2 forms, form1 and form2, on my form2 i have the checkboxes there, so if the user checked checkbox1, on my form1 it will only display 1 character, now if the user check all 5 checkboxes, my form1 will generate 5 characters. i have a button on form1 that will trigger an event on generating random characters. characters: '+','-','*','/','%' how will my code be? I am using WINDOWS FORMS APPLICATION. pics here: form1: http://i49.tinypic.com/30bzos8.png form2: http://i50.tinypic.com/k00ndt.png char[] select = new char[] { '+' , '-' , '*' , '/', '%' }; var rand = new Random(); char num = select[rand.Next(5)];

    Read the article

  • Access to Label value with Javascript

    - by streetparade
    I need to access to a value in a checkbox, the atribute value has content, so i need to place the id somewhere else i created a label, but i have not access to that value alert(check[i].label); // doesnt work where else can i place a value in checkbox. Please dont write that i can do this <input type='checkbox' id='bla' name='mybla' vlaue='myvalue'> Hy Where can i place some other values ? I tryed with this <input type='checkbox' id='bla' name='mybla' vlaue='myvalue' label='myothervalue'> Hy first i get all checkbox ect... and in the for loop i did this alert(check[i].label); // doesnt work How can i do that?

    Read the article

  • Single-Click Checkbox in RadGridView

    - by Anthony Trudeau
    Originally posted on: http://geekswithblogs.net/tonyt/archive/2014/06/05/156809.aspxThe Telerik RadGridView for WPF is a flexible visual control for displaying and manipulating tables of data. It’s not without it’s quirks though. I ran into one of those quirks recently. The behavior of the RadGridView requires that you first activate the cell for editing. That enables the editing controls underneath. Although that provides better editing capabilities, it also can be unintuitive. In my case I don’t want my users to have to click a checkbox value twice in order to change the value. This can be solved easily by setting the EditTriggers and AutoSelectOnEdit properties to CellClick and True respectively. Unfortunately, the story doesn’t end there. You would think you could set those properties in a style with a TargetType of GridViewCheckBoxColumn. You’d be wrong. <!-- This works --> <telerik:GridViewCheckBoxColumn Header="Flag #1"       DataMemberBinding="{Binding Flag1}"       EditTriggers="CellClick" AutoSelectOnEdit="True"/> <!-- This doesn’t work --> <Style TargetType="{x:Type telerik:GridViewCheckBoxColumn}">       <Setter Property="EditTriggers" Value="CellClick" />       <Setter Property="AutoSelectOnEdit" Value="True" /> </Style> Telerik told me that is the correct, expected behavior, because the columns in the RadGridView are not visual elements. Their explanation is that the Style property comes from the base class FrameworkContentElement, but the column objects aren’t visual elements. That may be an implementation truth, but that doesn’t make the behavior correct or expected. It’s unintuitive that the GridViewCheckBoxColumn exposes a Style property that cannot be used properly, but there it is. At least there’s a way to get the desired effect.

    Read the article

  • Get value of a checkbox?

    - by user246114
    Hi, I have a checkbox, how do I get its value using jquery? I have this example from searching: var checked = $('input[type=checkbox]:checked').val() != undefined; but how do I specify which checkbox I'm interested in, I want to only examine a checkbox with a particular id? Thanks

    Read the article

  • checkbox value after refresh

    - by moustafa
    hi guys, How to retain the checkbox value (in js) after refresh? There is a checkbox in this form. When the page is refreshed, the checkbox data disappears. Is there a way to refresh the page, while keeping the checkbox data? I have a window (#1) with a form and checkbox. #1 has a link to pop up another window (#2) with another form. When the form on #2 is completed, #1 is refreshed. My project is a combination of PHP and JS..please help Thank you.

    Read the article

  • How to get multiple value of checkbox?

    - by Poomjai
    I has checkbox the list of media in my webpage <input name="c1" type="checkbox" value=<%= item.MediaId %> />> mediaA <input name="c1" type="checkbox" value=<%= item.MediaId %> />> mediaB <input name="c1" type="checkbox" value=<%= item.MediaId %> />> mediaC In my javascript,How can i keep the checkbox value inside the array for example if user check for mediaA and mediaC in array will be {12,14} Thanks ^_^

    Read the article

  • Show/hide views with checkbox

    - by DixieFlatline
    Hi! I want to show or hide some elements (textviews and edittexts) with checkbox. I set their visibility to gone in layout file. Showing them when user checks the box works, but the when user unchecks it, they don't hide. (android 1.5 and 1.6) My code: cb=(CheckBox)findViewById(R.id.cek); cb.setOnClickListener(new OnClickListener() { // checkbox listener public void onClick(View v) { // Perform action on clicks, depending on whether it's now checked if (((CheckBox) v).isChecked()) { tv1.setVisibility(0); //visible==0 et3.setVisibility(0); } else if (((CheckBox) v).isChecked() == false) { tv1.setVisibility(2); //gone=2 et3.setVisibility(2); } } });

    Read the article

  • Jquery - check if atleast one checkbox is checked

    - by Vincent
    All, I have the following HTML form and it can have many checkboxes. When the submit button is clicked, I want the user to get a javascript alert to check atleast one checkbox if none are checked. Is there an easy way to do this using Jquery? <form name = "frmTest" id="frmTest"> <input type="checkbox" value="true" checked="true" name="chk[120]"> <input type="checkbox" value="true" checked="true" name="chk[128]"> <input type="checkbox" name="chk[130]"> <input type="checkbox" name="chk[143]"> <input type="submit" name="btnsubmit" value="Submit"> </form> Thanks

    Read the article

  • Problem getting value from "Checkbox group value prompt"

    - by Veer
    Hi, I've value prompt with ui:checkbox group parameter: p_IsLastMonth Name: Prompt_IsLastMonth ItemCount: 1; UseValue:Yes, DisplayValue: LastMonth? and two Date Prompts. Whenever the checkbox is checked, the UseValue 'Yes' is passed to the parameter 'p_IsLastMonth'. But whenever the checkbox is left as it is, it results in an error. Element 'selectOptions' is not valid for content model: 'All(style,defaultSelections,conditionalStyles,conditionalRender,XMLAttributes)' I also tried giving a default value. But the default value has to be in the collection. But i want only one checkbox to be displayed. I tried with html checkbox. But i'm not able to send the value 'either yes or no' to the parameter through javascript because however the finish button overrides the value. Any help?

    Read the article

  • System testing hangs inexplicably

    - by Jamess
    I read that I can upload system testing reports to ubuntu site and was excited with it. But my last three efforts looks like gives me a hung 'system testing' process or it appears so for about an hour each. How I can find out what is happening and if it indeed hung? https://launchpad.net/+login says I am already logged in, but I do not see any progress (or even unable to close the window as well) I am attaching the Screen shot as well:

    Read the article

  • checkbox dynamic create for jquery

    - by user1397840
    How do i create multiple checkbox for jquery to identify it? example i have a html page with this is call new.html <div id =new> <input type=checkbox"></div> at create.html i want to use jquery to load multiple checkbox <div id=load> <div> $("#load).load(new.html) so if i use a for loop to loop 10times to create 10 checkbox, how do i identify each checkbox uniquely? for(var i = 0;i<10;i++){ $("#load).load(new.html)}

    Read the article

  • checkbox like radiobutton wpf c#

    - by rockenpeace
    i have investigated this problem but this is solved in design view and code-behind. but my problem is little difference: i try to do this as only code-behind because my checkboxes are dynamically created according to database data.In other words, number of my checkboxes is not stable. i want to check only one checkbox in group of checkboxes. when i clicked one checkbox,i want that ischecked property of other checkboxes become false.this is same property in radiobuttons. i take my checkboxes from a stackpanel in xaml side: <StackPanel Margin="4" Orientation="Vertical" Grid.Row="1" Grid.Column="1" Name="companiesContainer"> </StackPanel> my xaml.cs: using (var c = new RSPDbContext()) { var q = (from v in c.Companies select v).ToList(); foreach (var na in q) { CheckBox ch = new CheckBox(); ch.Content = na.Name; ch.Tag = na; companiesContainer.Children.Add(ch); } } foreach (object i in companiesContainer.Children) { CheckBox chk = (CheckBox)i; chk.SetBinding(ToggleButton.IsCheckedProperty, "DataItem.IsChecked"); } how can i provide this property in checkboxes in xaml.cs ? thanks in advance..

    Read the article

  • Validating Checkbox and Radio Button in C#

    - by Solution
    Hi, I am using c# for coding! Below is my html for checkbox and radion button <input type="radio" style="float: left;" name="documents" id="Checkbox9" value="yes" runat="server" /> <label style="width: 35px!important;" class="checkbox"> <%=GetResourceString("c_HSGStudent")%> </label> <input type="radio" style="float: left;" name="documents" id="Checkbox10" value="no" runat="server" /> <label style="width: 25px!important;" class="checkbox"> <%=GetResourceString("c_HSGParent")%> </label> <input type="radio" style="float: left;" cheked name="documents" id="Radio1" value="yes" runat="server" /> <label style="width: 35px!important;" class="checkbox"> <%=GetResourceString("c_HSGStudent")%> </label> <input type="radio" style="float: left;" name="documents" id="Radio2" value="no" runat="server" /> <label style="width: 25px!important;" class="checkbox"> <%=GetResourceString("c_HSGParent")%> </label> You can see I have two checkboxes and two radio buttons, My problem is that on my submit button click I want to check whether user have checked at-least one checkbox or radio button. It will be good if we can have .NET solution like (customvalidator). Please suggest! Thanks

    Read the article

< Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >