Search Results

Search found 7706 results on 309 pages for 'checked'.

Page 14/309 | < Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >

  • how to access generated groupname for asp radiobutton

    - by rap-uvic
    Hi, I need to access radiobutton groupname in my jquery. However, groupname that's rendered for an asp radiobutton is kind of different. Example: <asp:RadioButton runat="server" GroupName="payment" ID="creditcard" Checked="true" value="creditcard" /> will generate: <input type="radio" checked="checked" value="creditcard" name="ctl00$ContentPlaceHolder1$payment" id="ctl00_ContentPlaceHolder1_creditcard"> I can't work with <%=creditcard.GroupName% in jquery. Is there a way I can get the generated groupname or name for it?

    Read the article

  • asp.net gridview

    - by arjun
    I have a gridview which has bound fields and a template field for checkbox.I wrote a code for deletion of records as per checking checkboxes.My problem is HtmlInputCheckBox chk; foreach(GridViewRow dr in dgvdetails.Rows) { chk = (HtmlInputCheckBox)dr.FindControl("ch"); chk.Checked = true; if (chk.Checked)/// **here checkbox is not checked even if I'm check it** { pl.id = int.Parse(chk.Value); bl.deletedgvdetails(pl); } }

    Read the article

  • IE not detecting jquery change method for checkbox

    - by user271619
    The code below works in FF, Safari, Chrome. But IE is giving me issues. When a checkbox is checked, I cannot get IE to detect it. $("#checkbox_ID").change(function(){ if($('#'+$(this).attr("id")).is(':checked')){ var value = "1"; }else{ var value = "0"; } alert(value); return false; }); Simply, I'm not getting that alert popup, as expected. I've even tried it this way: $("#checkbox_ID").change(function(){ if( $('#'+$(this).attr("id")'+:checked').attr('checked',false)){ var value = "1"; }else{ var value = "0"; } alert(value); return false; }); Here's the simple checkbox input: Anyone know if IE requires a different jquery method? or is my code just off?

    Read the article

  • jquery Tree Traversal prev() problem.

    - by Guido Lemmens
    Hello, I like to click a label and check the previous checkbox. I've tried the next code, but this is not working. I have tried for 2 hours, but what am i missing? JQUERY jQuery(document).ready(function() { $('.profilename').live('click', function() { if ($(this).prev("input:checked").val() != null) { $(this).prev("input").removeAttr("checked"); } else { $(this).prev("input").attr("checked","checked"); } }); }); HTML <input type="checkbox" class="check" name="example"> <label class="namelabel">John Doe</label> Who can help me to solve this question? Many thanks! p.s. I know i can easy solve this with the <label for=""> tag, but that is not the question.

    Read the article

  • Multi Select Checkbox using ListView

    - by Parsa
    I have a CheckBox in the header of ListView. I write a code to select all Checkboxes in ItemTemplate automatically when the user select the checkBox in the header of ListView. This code is useful, when you bind your ListView in DataPager_PreRender. protected void DataPager1_PreRender(object sender, EventArgs e) { //get the user id of the current user Guid userGuid = (Guid)Membership.GetUser().ProviderUserKey; ListView1.DataSource = MyClass.MyStaticMethod(userGuid.ToString()); ListView1.DataBind(); } protected void ListView1_ItemCreated(object sender, ListViewItemEventArgs e) { //Find the checkBox in each Row CheckBox checkBoxRow = e.Item.FindControl("CheckBoxRow") as CheckBox; //Assign the value of checkBoxHeader to the checkBoxRow checkBoxRow.Checked = CheckBoxHeader.Checked; } protected void ListView1_PagePropertiesChanged(object sender, EventArgs e) { // assign false value to the CheckBoxHeader when user click on the DataPager // so if checkboxheader is true in the page 1, when user select Page 2,this check box will be false // therefore all checkbox rows will be false in the new page. if (CheckBoxHeader.Checked == true) CheckBoxHeader.Checked = false; }

    Read the article

  • set radio button in jquery dialog

    - by RememberME
    I have the following if/else on another form and it works perfectly. I've now put it on a form which shows as a jquery dialog. Every alert along the way shows the correct assignment, but when the dialog opens, neither button is selected. $("#create-company").click(function() { alert($('#primary_company').val().length); if ($('#primary_company').val().length > 0) { alert("if secondary"); $('#secondary').attr('checked', 'true'); var id = $("input:radio[name='companyType']:checked").attr('id'); alert(id); } else { alert("else primary"); $('#primary').attr('checked', 'true'); $('#sec').hide(); var id = $("input:radio[name='companyType']:checked").attr('id'); alert(id); } var id = $("input:radio[name='companyType']:checked").attr('id'); alert(id); $('#popupCreateCompany').dialog('open'); }); Dialog: $('#popupCreateCompany').dialog( { autoOpen: false, modal: true, buttons: { 'Add': function() { var dialog = $(this); var form = dialog.find('input:text, select'); $.post('/company/post', $(form).serialize(), function(data) { if (data.Result == "success") { var id = $("input:radio[name='companyType']:checked").attr('id'); if (id == "primary") { $('#company').append($('<option></option>').val(data.company_id).html(data.company_name).attr("selected", true)); $('#primary_company').append($('<option></option>').val(data.company_id).html(data.company_name).attr("selected", true)); $('#company_id').append($('<option></option>').val(data.company_id).html(data.company_name).attr("selected", true)); } else { $('#company_id').append($('<option></option>').val(data.company_id).html(data.company_name)); } dialog.dialog('close'); alert("Company " + data.company_name + " successfully added."); } else { alert(data.Result); }; }, "json") }, 'Cancel': function() { $(this).dialog('close'); } } }); Radio buttons: <label>Company Type:</label> <label for="primary"><input onclick="javascript: $('#sec').hide('slow');$('#primary_company').find('option:first').attr('selected','selected');" type="radio" name="companyType" id="primary" />Primary</label> <label for="secondary"><input onclick="javascript: $('#sec').show('slow');" type="radio" name="companyType" id="secondary" />Subsidiary</label> <div id="sec"> <fieldset> <label for="primary_company">Primary Company:</label> <%= Html.DropDownList("primary_company", Model.SelectPrimaryCompanies, "** Select Primary Company **") %> </fieldset> </div>

    Read the article

  • Table filtering in jquery - a more elegant solution please

    - by Neil Burton
    I want to filter certain rows out of a table and am using classes to categorise the rows. The below code enables me to show and hide row data categorised as "QUO" and "CAL" (eventually there will be other categories. Can someone point me towards a more elegant solution, so I don't have to duplicate code for each category as I have below? Thanks! <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <html> <head> <title>Untitled</title> <style> </style> <script src="Javascript/jquery-1.4.2.min.js" type="text/javascript"></script> <script type="text/javascript"> $(document).ready(function () { $("#toggle_ac_cal").click(function() { var checked_status = this.checked; if (checked_status==true) { $(".ac_cal").show() } else { $(".ac_cal").hide() } }); $("#toggle_ac_quo").click(function() { var checked_status = this.checked; if (checked_status==true) { $(".ac_quo").show() } else { $(".ac_quo").hide() } }); }); </script> </head> <body> <input type="checkbox" id="toggle_ac_cal" checked="checked" />CAL<br/> <input type="checkbox" id="toggle_ac_quo" checked="checked" />QUO<br/> <table> <tbody> <tr class="ac_cal"> <td>CAL</td> <td>10 Oct</td> <td>John Barnes</td> </tr> <tr class="ac_cal"> <td>CAL</td> <td>10 Oct</td> <td>Neil Burton</td> </tr> <tr class="ac_quo"> <td>QUO</td> <td>11 Oct</td> <td>Neil Armstrong</td> </tr> </tbody> </table> </body> </html>

    Read the article

  • Setting checkstate on a ListWidgetItem

    - by viraptor
    Hi, I'm trying to create a list of checkbox items that change the status on activation. I can connect the activate signal and everything seems to work, but changes on the screen. Am I missing some steps here? Here's the list creation: self.listField = QtGui.QListWidget(self) muted_categories = qb.settingsCollection['mutedCategories'].split('|') main_categories = sorted(set(qb.categoryTopNames.values())) for category in main_categories: item = QtGui.QListWidgetItem(category, self.listField) item.setFlags(QtCore.Qt.ItemIsUserCheckable | QtCore.Qt.ItemIsEnabled) if category in muted_categories: item.setCheckState(QtCore.Qt.Checked) else: item.setCheckState(QtCore.Qt.Unchecked) self.listField.connect(self.listField, QtCore.SIGNAL('itemActivated(QListWidgetItem*)'), self.doItemChangeState) and here's the handler: def doItemChangeState(self, item): """ invert the state of the activated item """ if item.checkState() == QtCore.Qt.Checked: item.setCheckState(QtCore.Qt.Unchecked) else: item.setCheckState(QtCore.Qt.Checked) I verified that the handler is fired after clicking - if I put prints there, it will alternate "checked" / "unchecked". What can I do to refresh the checkboxes themselves?

    Read the article

  • how to read character behind some text

    - by klox
    this one a code for read two character behind text "KD-R411ED" var code = data[0].substr(data[0].length - 2); how to read ED character if text like KD-R411H2EDT? i want a new code can combine with code above..please help!! look this: $("#tags1").change(function() { var barcode; barCode=$("#tags1").val(); var data=barCode.split(" "); $("#tags1").val(data[0]); $("#tags2").val(data[1]); var code = data[0].substr(data[0].length - 2); // suggested by Jan Willem B if (code == 'UD') { $('#check1').attr('checked','checked'); } else { if (code == 'ED') { $('#check2').attr('checked','checked'); } }

    Read the article

  • jQuery programmatically removing validation highlighting

    - by Sam Carleton
    The form has two check boxes (cbDeclined & cbIsOOfFac), two text fields and a drop down (txtHeight, txtWeight, ddlDevice). If either check box is checked, then the other controls are disabled and the rules for the other do no apply. Here are the current rules: $('form').validate({ highlight: function (element, errorClass) { $(element).addClass("invalidElem"); }, unhighlight: function (element, errorClass) { $(element).removeClass("invalidElem"); }, errorPlacement: function (error, element) { var parent = element.parent(); parent.append(error); }, errorElement: "div", errorClass: "errorMsg" }); function HeightWeightCtrlsEnabled() { return !cbDeclined.is(':checked') && !cbIsOOfFac.is(':checked'); } txtHeight.rules("add", { required: function (element) { return HeightWeightCtrlsEnabled(); }, maxlength: 3, min: 1, digits: true }); txtWeight.rules("add", { required: function (element) { return HeightWeightCtrlsEnabled(); }, maxlength: 4, min: 1, digits: true }); ddlDevice.rules("add", { required: function (element) { return HeightWeightCtrlsEnabled(); } }); function UpdateTextBoxes() { var disableCtrls = !HeightWeightCtrlsEnabled(); txtHeight.prop('disabled', disableCtrls); txtWeight.prop('disabled', disableCtrls); ddlDevice.prop('disabled', disableCtrls); if (disableCtrls) { txtHeight.val(''); txtWeight.val(''); ddlDevice.val(''); } } cbDeclined.click(function () { if (cbDeclined.is(':checked')) cbIsOOfFac.attr('checked', false); UpdateTextBoxes(); }); cbIsOOfFac.click(function () { if (cbIsOOfFac.is(':checked')) cbDeclined.attr('checked', false); UpdateTextBoxes(); }); The problem comes in when: The user enters something into txtWeight, clicks the submit to get both ddlDevice & txtHeight to highlight because they are required, then... The user clicks on either cbDeclined & cbIsOOfFac. The highlight is NOT going away. I am trying to figure out how to get the highlighting around the height and drop down to go away. I tried to create a fully working jsFiddler, but I cannot get anything to work, though everything looks correct. here is the link (I cannot post links, so I expanded it a bit) jsfiddle dot net/scarleton/9hDZQ/12/ If you remove the last /12/, you will see my first version that is a cut/paste from the real thing. Per a suggestion I tried adding $('form').valid(); a number of places. When I added it to the end of the UpdateTextBoxes() function, they started out highlighted, not what I want. When I added it after the click() event of either of the radio button, the text would go away, but the actual controls stayed highlighted. It looks like the function on the required property of the rule is not fully working, maybe. What is really interesting is this: When I enter a height, click , then weight and device are highlighted and have the error message under them. When I click on one of the radio buttons, the text goes away, but the highlight does not. But... The height is NOT highlighted, it stays normal.

    Read the article

  • validate() > show field after radiobutton selection

    - by RihanU
    hi im saw this jquery script: http://jquery.bassistance.de/validate/demo/ and i want also the posibility to show a field when a button is checked but not with a checkbox. but with two radiobuttons. if radiobutton1 is checked, display field1 and if radiobutton2 is checked display field 2 what do i have to change..? <script type="text/javascript"> $().ready(function() { //code to hide topic selection, disable for demo var foo = $("#foo"); // foo topics are optional, hide first var inital = foo.is(":checked"); var topics = $("#blaat")[inital ? "removeClass" : "addClass"]("gray"); var topicInputs = topics.find("input").attr("disabled", !inital); // show when foo is checked foo.click(function() { topics[this.checked ? "removeClass" : "addClass"]("gray"); topicInputs.attr("disabled", !this.checked); }); }); </script> <form class="cmxform" id="signupForm" method="get" action=""> <fieldset> <p> <label for="foo">De checkbox dus veranderen naar 2 radio buttons</label> <input type="checkbox" class="checkbox" id="foo" name="foo" /> <!-- <input type="radio" value="ding" class="checkbox" id="foo" name="foo" /> <input type="radio" value="dong" class="checkbox" id="foo" name="foo" /> --> </p> <!-- Fieldset 1 --> <fieldset id="blaat"> <label for="topic_marketflash"> <input type="checkbox" id="topic_marketflash" value="marketflash" name="topic" /> Marketflash </label> <label for="topic_fuzz"> <input type="checkbox" id="topic_fuzz" value="fuzz" name="topic" /> Latest fuzz </label> <label for="topic_digester"> <input type="checkbox" id="topic_digester" value="digester" name="topic" /> Mailing list digester </label> </fieldset> <!-- --> <!-- Fieldset 2 --> <fieldset id="andere"> <label for="topic_marketflash"> <input type="checkbox" id="topic_marketflash" value="marketflash" name="topic" /> Voor </label> <label for="topic_fuzz"> <input type="checkbox" id="topic_fuzz" value="fuzz" name="topic" /> Beelden </label> </fieldset> <!-- --> </fieldset> </form>

    Read the article

  • use jquery to toggle disabled state with a radio button

    - by hbowman
    I want to toggle two radio buttons and select fields based on which radio button is selected. I have the jQuery working, but want to know if there is a way to make it more efficient. Seems like quite a few lines for the simple goal I am trying to achieve. Here are the requirements: when the page loads, #aircraftType should be checked and #aircraftModelSelect should be grayed out (right now, the "checked" is being ignored by Firefox). If the user clicks either #aircraftType or #aircraftModel, the opposite select field should become disabled (if #aircraftModel is checked, #aircraftTypeSelect should be disabled, and vise versa). Any help on optimizing this code is appreciated. Code is up on jsfiddle too: http://jsfiddle.net/JuRKn/ $("#aircraftType").attr("checked"); $("#aircraftModel").removeAttr("checked"); $("#aircraftModelSelect").attr("disabled","disabled").addClass("disabled"); $("#aircraftType").click(function(){ $("#aircraftModelSelect").attr("disabled","disabled").addClass("disabled"); $("#aircraftTypeSelect").removeAttr("disabled").removeClass("disabled"); }); $("#aircraftModel").click(function(){ $("#aircraftTypeSelect").attr("disabled","disabled").addClass("disabled"); $("#aircraftModelSelect").removeAttr("disabled").removeClass("disabled"); }); HTML <div class="aircraftType"> <input type="radio" id="aircraftType" name="aircraft" checked /> <label for="aircraftType">Aircraft Type</label> <select size="6" multiple="multiple" id="aircraftTypeSelect" name="aircraftType"> <option value="">Light Jet</option> <option value="">Mid-Size Jet</option> <option value="">Super-Mid Jet</option> <option value="">Heavy Jet</option> <option value="">Turbo-Prop</option> </select> </div> <div class="aircraftModel"> <input type="radio" id="aircraftModel" name="aircraft" /> <label for="aircraftModel">Aircraft Model</label> <select size="6" multiple="multiple" id="aircraftModelSelect" name="aircraftModel"> <option value="">Astra SP</option> <option value="">Beechjet 400</option> <option value="">Beechjet 400A</option> <option value="">Challenger 300</option> <option value="">Challenger 600</option> <option value="">Challenger 603</option> <option value="">Challenger 604</option> <option value="">Challenger 605</option> <option value="">Citation Bravo</option> </select> </div>

    Read the article

  • Everytime user types , in my text box i want it to become ',' or help me do it using a parameter

    - by MyHeadHurts
    I am using a vb.net textbox to become part of my IN sql statement in my program I tryed to use a parameter and it didn't work here is my code TextBox1.Text = "'Cruises','Caribbean and Mexico','CentralSouth America', 'Europe','Far East','France','Italy','London/UK','Middle East/Africa','South Pacific','Spain/Portugal','USA/Canada'" the default value of my textbox although the user can edit the textbox, but they would need to type the ',' which i would rather them just type , . and my other code is If RadioButtonList1.SelectedValue = "Sales" And CheckBox1.Checked = False Then 'saocmd1.CommandText = "SELECT dbo.B605SaleAsOfAdvancedMaster.SDESCR, dbo.B605SaleAsOfAdvancedMaster.DYYYY, dbo.B605SaleAsOfAdvancedMaster.AsOFSales, dbo.B605SaleAsOfAdvancedMaster.ASOFPAX, dbo.B605SaleAsOfAdvancedMaster.YESales, dbo.B605SaleAsOfAdvancedMaster.YEPAX, dbo.B604SalesAsOfAdvanced.Sales AS CurrentSales, dbo.B604SalesAsOfAdvanced.PAX AS CurrentPAX FROM B604SalesAsOfAdvanced INNER JOIN B605SaleAsOfAdvancedMaster ON dbo.B605SaleAsOfAdvancedMaster.SDESCR = B604SalesAsOfAdvanced.SDESCR WHERE (B605SaleAsOfAdvancedMaster.DYYYY =" & DropDownList1.SelectedValue & ") AND (B604SalesAsOfAdvanced.DYYYY = (DatePart(year, GetDate()) +1)) order by B605SaleAsOfAdvancedMaster.SDESCR" saocmd1.CommandText = "SELECT dbo.B605SaleAsOfAdvancedMaster.SDESCR, dbo.B605SaleAsOfAdvancedMaster.DYYYY, dbo.B605SaleAsOfAdvancedMaster.AsOFSales, dbo.B605SaleAsOfAdvancedMaster.ASOFPAX, dbo.B605SaleAsOfAdvancedMaster.YESales, dbo.B605SaleAsOfAdvancedMaster.YEPAX, dbo.B604SalesAsOfAdvanced.Sales AS CurrentSales, dbo.B604SalesAsOfAdvanced.PAX AS CurrentPAX FROM B604SalesAsOfAdvanced INNER JOIN B605SaleAsOfAdvancedMaster ON dbo.B605SaleAsOfAdvancedMaster.SDESCR = B604SalesAsOfAdvanced.SDESCR WHERE (B605SaleAsOfAdvancedMaster.DYYYY =@Dyyyy) AND (B604SalesAsOfAdvanced.DYYYY = (DatePart(year, GetDate()) +1)) and dbo.B605SaleAsOfAdvancedMaster.SDESCR in ('Cruises','Caribbean and Mexico','CentralSouth America', 'Europe','Far East','France','Italy','London/UK','Middle East/Africa','South Pacific','Spain/Portugal','USA/Canada') order by B605SaleAsOfAdvancedMaster.SDESCR" Label2.Text = "Sales" ElseIf RadioButtonList1.SelectedValue = "NetSales" And CheckBox1.Checked = False Then saocmd1.CommandText = "SELECT dbo.B605SaleAsOfAdvancedMaster.SDESCR, dbo.B605SaleAsOfAdvancedMaster.DYYYY, (ISNULL(dbo.B605SaleAsOfAdvancedMaster.AsOFNET,0) + (ISNULL(dbo.B605SaleAsOfAdvancedMaster.AsOFOther,0))) as AsofSales, dbo.B605SaleAsOfAdvancedMaster.ASOFPAX, (ISNULL(dbo.B605SaleAsOfAdvancedMaster.YENET,0) + (ISNULL(dbo.B605SaleAsOfAdvancedMaster.YEOther,0))) as YESales, dbo.B605SaleAsOfAdvancedMaster.YEPAX, (ISNULL(dbo.B604SalesAsOfAdvanced.netSales,0) + (ISNULL(dbo.B604SalesAsOfAdvanced.OtherSales,0))) as CurrentSales, dbo.B604SalesAsOfAdvanced.PAX AS CurrentPAX FROM B604SalesAsOfAdvanced INNER JOIN B605SaleAsOfAdvancedMaster ON dbo.B605SaleAsOfAdvancedMaster.SDESCR = B604SalesAsOfAdvanced.SDESCR WHERE (B605SaleAsOfAdvancedMaster.DYYYY =@Dyyyy) AND (B604SalesAsOfAdvanced.DYYYY = (DatePart(year, GetDate()) +1)) and dbo.B605SaleAsOfAdvancedMaster.SDESCR in ('Cruises','Caribbean and Mexico','CentralSouth America', 'Europe','Far East','France','Italy','London/UK','Middle East/Africa','South Pacific','Spain/Portugal','USA/Canada') order by B605SaleAsOfAdvancedMaster.SDESCR" Label2.Text = "Net Sales" ElseIf RadioButtonList1.SelectedValue = "INSSales" And CheckBox1.Checked = False Then saocmd1.CommandText = "SELECT dbo.B605SaleAsOfAdvancedMaster.SDESCR, dbo.B605SaleAsOfAdvancedMaster.DYYYY, ISNULL(dbo.B605SaleAsOfAdvancedMaster.AsOFINS,0)as AsofSales, dbo.B605SaleAsOfAdvancedMaster.ASOFPAX, ISNULL(dbo.B605SaleAsOfAdvancedMaster.YEINS,0) as YESales, dbo.B605SaleAsOfAdvancedMaster.YEPAX, ISNULL(dbo.B604SalesAsOfAdvanced.INSSales,0) as CurrentSales, dbo.B604SalesAsOfAdvanced.PAX AS CurrentPAX FROM B604SalesAsOfAdvanced INNER JOIN B605SaleAsOfAdvancedMaster ON dbo.B605SaleAsOfAdvancedMaster.SDESCR = B604SalesAsOfAdvanced.SDESCR WHERE (B605SaleAsOfAdvancedMaster.DYYYY =@Dyyyy) AND (B604SalesAsOfAdvanced.DYYYY = (DatePart(year, GetDate()) +1)) and dbo.B605SaleAsOfAdvancedMaster.SDESCR in ('Cruises','Caribbean and Mexico','CentralSouth America', 'Europe','Far East','France','Italy','London/UK','Middle East/Africa','South Pacific','Spain/Portugal','USA/Canada') order by B605SaleAsOfAdvancedMaster.SDESCR" Label2.Text = "Insurance Sales" ElseIf RadioButtonList1.SelectedValue = "CXSales" And CheckBox1.Checked = False Then saocmd1.CommandText = "SELECT dbo.B605SaleAsOfAdvancedMaster.SDESCR, dbo.B605SaleAsOfAdvancedMaster.DYYYY, ISNULL(dbo.B605SaleAsOfAdvancedMaster.AsOFCX,0)as AsofSales, dbo.B605SaleAsOfAdvancedMaster.ASOFPAX, ISNULL(dbo.B605SaleAsOfAdvancedMaster.YECX,0) as YESales, dbo.B605SaleAsOfAdvancedMaster.YEPAX, ISNULL(dbo.B604SalesAsOfAdvanced.CXSales,0) as CurrentSales, dbo.B604SalesAsOfAdvanced.PAX AS CurrentPAX FROM B604SalesAsOfAdvanced INNER JOIN B605SaleAsOfAdvancedMaster ON dbo.B605SaleAsOfAdvancedMaster.SDESCR = B604SalesAsOfAdvanced.SDESCR WHERE (B605SaleAsOfAdvancedMaster.DYYYY =@Dyyyy) AND (B604SalesAsOfAdvanced.DYYYY = (DatePart(year, GetDate()) +1)) and dbo.B605SaleAsOfAdvancedMaster.SDESCR in ('Cruises','Caribbean and Mexico','CentralSouth America', 'Europe','Far East','France','Italy','London/UK','Middle East/Africa','South Pacific','Spain/Portugal','USA/Canada') order by B605SaleAsOfAdvancedMaster.SDESCR" Label2.Text = "Canceled Sales" ElseIf RadioButtonList1.SelectedValue = "Sales" And CheckBox1.Checked = True Then saocmd1.CommandText = "SELECT dbo.B605SaleAsOfAdvancedMaster.SDESCR, dbo.B605SaleAsOfAdvancedMaster.DYYYY, dbo.B605SaleAsOfAdvancedMaster.AsOFSales, dbo.B605SaleAsOfAdvancedMaster.ASOFPAX, dbo.B605SaleAsOfAdvancedMaster.YESales, dbo.B605SaleAsOfAdvancedMaster.YEPAX, dbo.B604SalesAsOfAdvanced.Sales AS CurrentSales, dbo.B604SalesAsOfAdvanced.PAX AS CurrentPAX FROM B604SalesAsOfAdvanced INNER JOIN B605SaleAsOfAdvancedMaster ON dbo.B605SaleAsOfAdvancedMaster.SDESCR = B604SalesAsOfAdvanced.SDESCR WHERE (B605SaleAsOfAdvancedMaster.DYYYY =@Dyyyy) AND (B604SalesAsOfAdvanced.DYYYY = (DatePart(year, GetDate()) +1)) and dbo.B605SaleAsOfAdvancedMaster.SDESCR in (" & TextBox1.Text & ") order by B605SaleAsOfAdvancedMaster.SDESCR" Label2.Text = "Sales" ElseIf RadioButtonList1.SelectedValue = "NetSales" And CheckBox1.Checked = True Then saocmd1.CommandText = "SELECT dbo.B605SaleAsOfAdvancedMaster.SDESCR, dbo.B605SaleAsOfAdvancedMaster.DYYYY, (ISNULL(dbo.B605SaleAsOfAdvancedMaster.AsOFNET,0) + (ISNULL(dbo.B605SaleAsOfAdvancedMaster.AsOFOther,0))) as AsofSales, dbo.B605SaleAsOfAdvancedMaster.ASOFPAX, (ISNULL(dbo.B605SaleAsOfAdvancedMaster.YENET,0) + (ISNULL(dbo.B605SaleAsOfAdvancedMaster.YEOther,0))) as YESales, dbo.B605SaleAsOfAdvancedMaster.YEPAX, (ISNULL(dbo.B604SalesAsOfAdvanced.netSales,0) + (ISNULL(dbo.B604SalesAsOfAdvanced.OtherSales,0))) as CurrentSales, dbo.B604SalesAsOfAdvanced.PAX AS CurrentPAX FROM B604SalesAsOfAdvanced INNER JOIN B605SaleAsOfAdvancedMaster ON dbo.B605SaleAsOfAdvancedMaster.SDESCR = B604SalesAsOfAdvanced.SDESCR WHERE (B605SaleAsOfAdvancedMaster.DYYYY =@Dyyyy) AND (B604SalesAsOfAdvanced.DYYYY = (DatePart(year, GetDate()) +1)) and dbo.B605SaleAsOfAdvancedMaster.SDESCR in (" & TextBox1.Text & ") order by B605SaleAsOfAdvancedMaster.SDESCR" Label2.Text = "Net Sales" ElseIf RadioButtonList1.SelectedValue = "INSSales" And CheckBox1.Checked = True Then saocmd1.CommandText = "SELECT dbo.B605SaleAsOfAdvancedMaster.SDESCR, dbo.B605SaleAsOfAdvancedMaster.DYYYY, ISNULL(dbo.B605SaleAsOfAdvancedMaster.AsOFINS,0)as AsofSales, dbo.B605SaleAsOfAdvancedMaster.ASOFPAX, ISNULL(dbo.B605SaleAsOfAdvancedMaster.YEINS,0) as YESales, dbo.B605SaleAsOfAdvancedMaster.YEPAX, ISNULL(dbo.B604SalesAsOfAdvanced.INSSales,0) as CurrentSales, dbo.B604SalesAsOfAdvanced.PAX AS CurrentPAX FROM B604SalesAsOfAdvanced INNER JOIN B605SaleAsOfAdvancedMaster ON dbo.B605SaleAsOfAdvancedMaster.SDESCR = B604SalesAsOfAdvanced.SDESCR WHERE (B605SaleAsOfAdvancedMaster.DYYYY =@Dyyyy) AND (B604SalesAsOfAdvanced.DYYYY = (DatePart(year, GetDate()) +1)) and dbo.B605SaleAsOfAdvancedMaster.SDESCR in (" & TextBox1.Text & ") order by B605SaleAsOfAdvancedMaster.SDESCR" Label2.Text = "Insurance Sales" ElseIf RadioButtonList1.SelectedValue = "CXSales" And CheckBox1.Checked = True Then saocmd1.CommandText = "SELECT dbo.B605SaleAsOfAdvancedMaster.SDESCR, dbo.B605SaleAsOfAdvancedMaster.DYYYY, ISNULL(dbo.B605SaleAsOfAdvancedMaster.AsOFCX,0)as AsofSales, dbo.B605SaleAsOfAdvancedMaster.ASOFPAX, ISNULL(dbo.B605SaleAsOfAdvancedMaster.YECX,0) as YESales, dbo.B605SaleAsOfAdvancedMaster.YEPAX, ISNULL(dbo.B604SalesAsOfAdvanced.CXSales,0) as CurrentSales, dbo.B604SalesAsOfAdvanced.PAX AS CurrentPAX FROM B604SalesAsOfAdvanced INNER JOIN B605SaleAsOfAdvancedMaster ON dbo.B605SaleAsOfAdvancedMaster.SDESCR = B604SalesAsOfAdvanced.SDESCR WHERE (B605SaleAsOfAdvancedMaster.DYYYY =@Dyyyy) AND (B604SalesAsOfAdvanced.DYYYY = (DatePart(year, GetDate()) +1)) and dbo.B605SaleAsOfAdvancedMaster.SDESCR in (" & TextBox1.Text & ") order by B605SaleAsOfAdvancedMaster.SDESCR" Label2.Text = "Canceled Sales" End If Basically what is happening is, if a certain radio button is selected and the user didn't click the checkbox the default regions are included and they are hardcoded because the query runs much faster. if the user did click the checkbox then the textbox where they type the specific regions shows up and it will run the query that includes the dbo.B605SaleAsOfAdvancedMaster.SDESCR in (" & TextBox1.Text & ") If you can somehow do this using parameters and not with the textbox1.text in the query it will run much faster for me thanks for your help

    Read the article

  • Hotkey to toggle checkboxes does opposite

    - by Joel Harris
    In this jsFiddle, I have a table with checkboxes in the first column. The master checkbox in the table header functions as expected toggling the state of all the checkboxes in the table when it is clicked. I have set up a hotkey for "shift-x" to toggle the master checkbox. The desired behavior when using the hotkey is: The master checkbox is toggled The child checkboxes each have their checked state set to match the master But what is actually happening is the opposite... The child checkboxes each have their checked state set to match the master The master checkbox is toggled Here is the relevant code $(".master-select").click(function(){ $(this).closest("table").find("tbody .row-select").prop('checked', this.checked); }); function tickAllCheckboxes() { var master = $(".master-select").click(); } //using jquery.hotkeys.js to assign hotkey $(document).bind('keydown', 'shift+x', tickAllCheckboxes); This results in the child checkboxes having the opposite checked state of the master checkbox. Why is that happening? A fix would be nice, but I'm really after an explanation so I can understand what is happening.

    Read the article

  • How to get a list of unchecked checkboxes when submittimg a form?

    - by SzamDev
    Hi I have this code for example : $b = ""; while ($row = mysql_fetch_array($rows)) { if ($row['enabled'] == 1) { $b = "checked"; } else { $b = "": } echo ""; } When I execute this code, I will get a list of checkboxes, some of them are checked and others are not. I can use this code to get a list of checked checkboxes. if (isset($_POST['sub'])) { //check if form has been submitted or not $nam = $_POST['nam']; if (!empty($nam)) { foreach($nam as $k=>$val){ // proccess operation with checked checkboxes } } I need to know how I can get list of unckecked checkboxes after submitting the form. Thanks in advance.

    Read the article

  • toggleClass messing something up.

    - by Mathias Nielsen
    Hi I am using playing around with the Pretty-checkboxes-plugin and have a problem. The plugin can be seen here http://aaronweyenberg.com/90/pretty-checkboxes-with-jquery As you can see, this uses two links to select and deselect. I want it to only use one link and then change the class to make it work the other way the next time it is clicked. It should be simple enough. I have been trying to get it working with toggleClass. I simply put in the toggleClass statement so the code looks like so: $(document).ready(function() { /* see if anything is previously checked and reflect that in the view*/ $(".checklist input:checked").parent().addClass("selected"); /* handle the user selections */ $(".checklist .checkbox-select").click( function(event) { event.preventDefault(); $(this).parent().addClass("selected"); $(this).parent().find(":checkbox").attr("checked","checked"); $(this).toggleClass("checkbox-select checkbox-deselect"); } ); $(".checklist .checkbox-deselect").click( function(event) { event.preventDefault(); $(this).parent().removeClass("selected"); $(this).parent().find(":checkbox").removeAttr("checked"); $(this).toggleClass("checkbox-select checkbox-deselect"); } ); }); This works to some extend. The classes toggle just fine, but the rest of the code only works the first time it is run. All subsequent clicks just toggle the class og the link and nothing else. Does anyone have any idea why this is?

    Read the article

  • How to get a list of unchecked checkboxes when submitting a form?

    - by SzamDev
    Hi I have this code for example : $b = ""; while ($row = mysql_fetch_array($rows)) { if ($row['enabled'] == 1) { $b = "checked"; } else { $b = "": } echo "<\input name='nam[$row[id]]' type='checkbox' value='$row[id]' $b /"; } When I execute this code, I will get a list of checkboxes, some of them are checked and others are not. I can use this code to get a list of checked checkboxes. if (isset($_POST['sub'])) { //check if form has been submitted or not $nam = $_POST['nam']; if (!empty($nam)) { foreach($nam as $k=>$val){ // proccess operation with checked checkboxes } } I need to know how I can get list of unckecked checkboxes after submitting the form. Thanks in advance.

    Read the article

  • Javascript: Check if checkboxes are selected on page load and add a class to parent html li

    - by BoDiE2003
    Im looking a way to do it with prototype, this js, needs to loads with the page and interate over all the elements (inputs - checkboxes, in this case) with the given id and assign a class to its parent <li></li> The JS is: function changeSelectionStyle(id) { var inputId = id.substr(0,id.length-2); if(document.getElementById(inputId).checked){document.getElementById(id).className = 'yes';} alert(document.getElementById(inputId).checked); /* * if(document.getElementById(id).className != 'yes'){ * document.getElementById(id).className = 'yes'; * } else{document.getElementById(id).className = '';} */ } And the HTML (piece of it) that interacts with this JS is: <li id="selectedAuthorities-4_1li"> <input type="checkbox" id="selectedAuthorities-4_1" name="selectedAuthorities" value="ROLE_ADD_COMMENT_TO_CV" checked="checked" onclick="changeSelectionStyle(this.id + 'li'); checkFatherSelection(this.id);"> <a href="#" onclick="document.getElementById('selectedAuthorities-4_1').click(); return false;"> Agregar comentario <samp><b></b>Permite agregar comentario en el detalle</samp> </a> </li> After iteration, checking is the checkbox is checked, it has to add the class="yes" to the <li id="selectedAuthorities-4_1li">

    Read the article

  • .change(function) can control two command

    - by klox
    dear all..i've a textfield, it using barcode scanner for input data..after scan it shows KD-R411ED 105X0001... I'm successful separate them into two text field use ".change(function)" $("#tags1").change(function() { var barcode; barCode=$("#tags1").val(); var data=barCode.split(" "); $("#tags1").val(data[0]); $("#tags2").val(data[1]); }); what i want is beside make them separate after ".change(function)" another script can read two character behind "KD-R411ED"..that is "ED"..this character can make a radiobutton which id="check1" are checked.. what's code which can combine with code above? this my complete code.. $("#tags1").change(function() { var barcode; barCode=$("#tags1").val(); var data=barCode.split(" "); $("#tags1").val(data[0]); $("#tags2").val(data[1]); var code = data[0].substr(data[0].length - 2); // suggested by Jan Willem B if (code =='UD') $('#check1').attr('checked','checked'); } else { if (code == 'ED') { $('#check2').attr('checked','checked'); } } and this the form <input id="check1" type="radio" class="check" name="check" onclick="addtext()" value="U" />U <input id="check2" type="radio" class="check" name="check" onclick="addtext_1()" value="E" />E the radiobutton still not response

    Read the article

  • Get a selected radio button value after POST to set other fields enabled/disabled

    - by Redeemed1
    I have an MVC application with a simple control to all selection of All Dates or selecting a Date Range. The radio buttons have an onclick handler to enable/disable the dat pickers. All work well so far. When I try to set the correct context state for the datepickers after doing a POST I cannot get the jQuery selector to return the radio buttons checked value. The code is as follows: <%= Html.RadioButton("DateSelection.AllDates", "AllDates", Model.AllDates == "AllDates", new { onclick = "setReadOnly(this);" })%>ALL Dates&nbsp; <%= Html.RadioButton("DateSelection.AllDates", "Selection", Model.AllDates == "Selection", new { onclick = "setReadOnly(this);" })%>Selection <%= Html.DatePicker("DateSelection.startdate", Model.StartDate, "", "") %> &nbsp;To&nbsp;<%= Html.DatePicker("DateSelection.enddate", Model.EndDate, "", "") %><br /> The javascript is as follows: <script type="text/jscript" > function setReadOnly(obj) { if (obj.value == "Selection") { $('#DateSelection_startdate').css('backgroundColor', '#ffffff') .removeAttr('readonly') .datepicker('enable'); $('#DateSelection_enddate').css('backgroundColor', '#ffffff') .removeAttr('readonly') .datepicker('enable'); } else { $('#DateSelection_startdate').css('backgroundColor', '#eeeeee') .attr('readonly', 'readonly') .val('') .datepicker('disable'); $('#DateSelection_enddate').css('backgroundColor', '#eeeeee') .attr('readonly', 'readonly') .val('') .datepicker('disable'); } } <script type="text/jscript"> $(document).ready(function() { $('#DateSelection_startdate').datepicker('disable').css('backgroundColor', '#eeeeee') .attr('readonly', 'readonly') .val(''); $('#DateSelection_enddate').datepicker('disable').css('backgroundColor', '#eeeeee') .attr('readonly', 'readonly') .val(''); var selected = $('#DateSelection_AllDates:checked'); setReadOnly(selected); }); The javascript line that is causing the problem is var selected = $('#DateSelection_AllDates:checked'); which will NOT return the checked radio button. Using var selected = $('#DateSelection_AllDates'); will return the first radio button value as expected i.e. applying the ':checked' filter ALWAYS returns undefined. Can anyone see anything wrong here?

    Read the article

  • how to prevent checkbox check when clicking on link inside label

    - by dalbaeb
    Hello, I have a link inside a label. The problem is, when user clicks 'back' after having read the terms, the checkbox is unchecked, because when they clicked on the link they also unchecked the box at the same time, since the link is inside a label. <input type="checkbox" id="terms" name="terms" checked="checked" /> <label for="terms">I agree to be bound by the <a href="/terms">Terms</a></label> How can I prevent the checkbox from being checked when link is clicked? Tried doing event.preventDefault() on label click, but that doesn't prevent checkbox from being checked/unchecked. I could just take out the link from inside a label (which means more CSS styling). But now I'm curious whether the above is possible.

    Read the article

  • RadioButton checkedchanged event firing multiple times

    - by kash3
    Hi, I am trying to add multiple radiobutton columns to my gridview dynamically in the code and i want to implement some logic which involves database fetch in the checkedchanged event of radiobuttons but some how the checked changed event is being fired multiple times for each row. Following is the code: aspx: <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" BackColor="White" BorderColor="#CC9966" BorderStyle="None" EnableViewState="true" BorderWidth="1px" CellPadding="4" Font-Names="Verdana"> <FooterStyle BackColor="#FFFFCC" ForeColor="#330099" /> <Columns> <asp:TemplateField HeaderText="Select One"> <ItemTemplate> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="Select Two"> <ItemTemplate> </ItemTemplate> </asp:TemplateField> <asp:TemplateField> <ItemTemplate> <asp:Label ID="lblval" runat="server" Text="!" ForeColor="Red" Visible="false"/> </ItemTemplate> </asp:TemplateField> </Columns> **code behind** void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.DataItem != null) { DataRowView dvRowview = (DataRowView)e.Row.DataItem; int currentRow = GridView1.Rows.Count; RadioButton rdoSelect1 = new RadioButton(); rdoSelect1.GroupName = "Select" + currentRow; rdoSelect1.ID = string.Concat("rdoSelect1", currentRow); rdoSelect1.AutoPostBack = true; rdoSelect1.CheckedChanged += new EventHandler(rdoSelect_CheckedChanged); e.Row.Cells[0].Controls.Add(rdoSelect1); RadioButton rdoSelect2 = new RadioButton(); rdoSelect2.GroupName = "Select" + currentRow; rdoSelect2.ID = string.Concat("rdoSelect2", currentRow); rdoSelect2.AutoPostBack = true; rdoSelect2.CheckedChanged += new EventHandler(rdoSelect_CheckedChanged); e.Row.Cells[1].Controls.Add(rdoSelect2); if (!IsPostBack) { e.Row.Cells[e.Row.Cells.Count - 1].Controls[1].Visible = false; if (e.Row.Cells[0] != null && Convert.ToBoolean(dvRowview["Select1"]) == true) rdoSelect1.Checked = true; else rdoSelect1.Checked = false; if (e.Row.Cells[0] != null && Convert.ToBoolean(dvRowview["Select2"]) == true) rdoSelect2.Checked = true; else rdoSelect2.Checked = false; } } } void rdoSelect_CheckedChanged(object sender, EventArgs e) { RadioButton rdoSelectedOption = (RadioButton)sender; GridViewRow selRow = rdoSelectedOption.NamingContainer as GridViewRow; if (rdoSelectedOption.Checked) selRow.Cells[selRow.Cells.Count - 1].Controls[1].Visible = true; else selRow.Cells[selRow.Cells.Count - 1].Controls[1].Visible = false; } i want the checkedchanged event to fire only once for a group name and row.

    Read the article

  • How can I write this as a JavaScript function?

    - by Haluk
    I have the following code snippet embedded into some of my divs so when those divs get clicked a certain radio button gets checked. onclick="document.g1.city[0].checked=true;" However I would like to convert the above call to a function call like below: onclick="checkRadioButton(city[0]);" And the function will be something like this function checkRadioButton(input){ document.g1.input.checked=true; } Is there a way I can accomplish this?

    Read the article

  • How do I create a loop based off this array?

    - by dmanexe
    I'm trying to process this array, first testing for the presence of a check, then extrapolating the data from quantity to return a valid price. Here's the input for fixed amounts of items, with no variable quantity. <input type="checkbox" name="measure[<?=$item->id?>][checked]" value="<?=$item->id?>"> <input type="hidden" name="measure[<?=$item->id?>][quantity]" value="1" /> Here's the inputs for variable amounts of items. <input type="checkbox" name="measure[<?=$item->id?>][checked]" value="<?=$item->id?>"> <input class="item_mult" value="0" type="text" name="measure[<?=$item->id?>][quantity]" /> So, the resulting array is multidimensional. Here's an output: Array ( [1] => Array ( [quantity] => 1 ) [2] => Array ( [quantity] => 1 ) [3] => Array ( [quantity] => 1 ) ... [14] => Array ( [checked] => 14 [quantity] => 999 ) ) Here's the loop I'm using to take this array and process items checked off the form in the first place. I guess the question essentially boils down to how do I structure my conditional statement to incorporate the multi-dimensional array? foreach($field as $value): if ($value['checked'] == TRUE) { $query = $this->db->get_where('items', array('id' => $value['checked']))->row(); #Test to see if quantity input is present if ($value['quantity'] == TRUE) { $newprice = $value['quantity'] * $query->price; $totals[] = $newprice; } #Just return the base value if not else { $newprice = $query->price; $totals[] = $newprice; } } else { } ?> <p><?=$query->name?> - <?=money_format('%(#10n', $newprice)?></p> <? endforeach; ?>

    Read the article

< Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >