dimanche 31 juillet 2022

Checkbox - connecting 2 checkboxs with arrow

I need to connect 2 checkboxs with each other when i swipe from checkbox to checkbox like this.can i do it.

example




Python Tkinter Checkboxes created in function after user action

I am working on a small Python program that connects to a SQLite Database and allows the user to CRUD the data from several tables. I'm having a problem with some checkboxes that are not created until the user has made several other selections and pushed a button. The number of checkboxes and the initial state of each checkbox is not known until the user has made their selections and the queries have returned. The SQL queries are working correctly and the list of checkboxes is also created correctly but none of the checkboxes are checked initially even though the variable is correctly set based on the return of the SQL query. Here is a simplified version of my code that removes the SQL stuff but still has the problem.

from tkinter import *
ws = Tk()

def ViewTopics():
    titles = ["check1", "check2"]
    temp = [1,0]
    onoff = []
    i = 0
    for title in titles:
        if temp[i] > 0:
            onoff.append(IntVar(value = 1))
        else:
            onoff.append(IntVar(value = 0))
        i = i + 1
    i = 0
    for title in titles:
        l = Checkbutton(topicframe, text=titles[0], variable = onoff[i])
        l.grid(row=i+1, column=0, sticky=W)
        i = i + 1
        
topicframe = Frame(ws, padx=10, pady=10, relief='sunken', borderwidth = 1)
topicframe.grid(row=1, column=0, sticky=NSEW, padx=3, pady=3)

topicbutton = Button(ws, text = "Get Checkboxes", command=ViewTopics)
topicbutton.grid(row=0, column=0, sticky=EW)
    
ws.mainloop()

I have simplified this by hardwiring the titles array and the temp array. In the full code, these are filled in with information from the SQL queries. I know that my queries are working and that the arrays are correctly set up in my full code.

Note that the creation of the checkboxes must be in a loop because I don't know how many checkboxes there will be in advance. Also, I need to create the checkboxes in the function because I won't know what queries need to be run until the user makes some other selections (not included in this simplified code version) and then clicks the button.

If I print the onoff array in the second for-loop, the values are correct, but the first checkbox is not selected as intended. I have tried using l.select() in the second for-loop when onoff[i] is 1, but besides the fact that I shouldn't have to do that, it doesn't make a difference anyway.

I believe the problem is either with the use of a function or with the fact that the checkboxes are not created at the beginning like the other widgets. If I hardwire the arrays as I've done here and create the checkboxes without a function, they work correctly. But that doesn't meet the needs of my program.

Does anybody have any ideas on how to set this up correctly?




samedi 30 juillet 2022

Including checkbox values in php mail

I have this form that includes checkboxes. And I want a mail to be sent on submission of the form with the value of the checked checkbox og checkboxes. but the code doesn't work. Any help?

It tells me on submission that the form was submitted successfully and not including any errors. But I don't receive the email.

                <form id="contact-form" method="POST" action="contact-form-handle.php">
                    <h3 class="contact-im">I'm interested in. . .</h3>
                    <div class="interested-container">
                        <div class="checkbox-frame">
                            <input class="checkbox_form" type="checkbox" name="category[]" id="PHOTOGRAPHY" value="PHOTOGRAPHY"><br>
                            <label class="form-label" for="PHOTOGRAPHY">PHOTOGRAPHY</label>
                        </div>

                        <div class="checkbox-frame">
                            <input class="checkbox_form" type="checkbox" name="category[]" id="GRAPHIC-DESIGN"  value="GRAPHIC-DESIGN"><br>
                            <label for="GRAPHIC-DESIGN">GRAPHIC DESIGN</label>
                        </div>

                        <div class="checkbox-frame">
                            <input class="checkbox_form" type="checkbox" name="category[]" id="LIVE-INSTALLATION"  value="LIVE"><br>
                            <label for="LIVE-INSTALLATION">LIVE INSTALLATION</label>
                        </div>
                        
                        <div class="checkbox-frame">
                            <input class="checkbox_form" type="checkbox" name="category[]" id="VIDEOGRAPHY"  value="VIDEOGRAPHY"><br>
                            <label for="VIDEOGRAPHY">VIDEOGRAPHY</label>
                        </div>
                        
                        <div class="checkbox-frame">
                            <input class="checkbox_form" type="checkbox" name="category[]" id="PERSONAL-PROJECTS"  value="PERSONAL-PROJECTS"><br>
                            <label for="PERSONAL-PROJECTS">PERSONAL PROJECTS</label>
                        </div>

                        <div class="checkbox-frame">
                            <input class="checkbox_form" type="checkbox" name="category[]" id="OTHER"  value="OTHER"><br>
                            <label for="OTHER">OTHER</label>
                        </div>
                    </div>

                    <input name="name" type="text" class="form-control" placeholder="Name / Company. . ." required>
                    <br>
                    <input name="email" type="email" class="form-control" placeholder="Email. . ." required>
                    <br>
                    <textarea name="message" class="form-control" rows="4" placeholder="Message. . ." required></textarea>
                    <br>
                    <input type="submit" class="form-control submit" value="Submit ">
                </form>```

and the php:

```<?php

    $name = $_POST['name'];
    $visitor_email = $_POST['email'];
    $message = $_POST['message'];

    if(!empty($_POST["category"]))                         //check if the user has selected a CHECKBOX or NOT 
    {
    $checkbox =$_POST["category"];                //Array of values from the checkbox
    
    foreach($checkbox as $value)             //loop to store and display values of individual checkboxes 
    {echo $value;}}                        //Display selected checkbox
   else {test_input($_POST["value"]);
} 

    $mailheader = "From:".$name."<".$email.">\r\n";

    $reciepient = "mathiasqm@gmail.com";

    mail($reciepient, 'Website Lead Gen', $message, $mailheader, $value)
    or die("Error!");

    echo'Message successfully submitted';


?>```



How can I add the parent checkbox to the Vuetify datagrid group table?

When I use the vuetify data datable group feature, the following view is obtained by default.

enter image description here

But I want to add a checkbox to grouped rows and add a parent checkbox to have child rows marked with a single selection.

enter image description here

The default example is available at this address. https://codepen.io/ersin-g-ven-/pen/PoREoNj

<div id="app">
  <v-app id="inspire">
    <h5>Selected: </h5>
    <v-data-table
      v-model="selected"
      :headers="headers"
      :items="desserts"
      item-key="name"
      show-select
      @click:row="handleClick"
      group-by="category"
      class="elevation-1"
      show-group-by
    >
     
    </v-data-table>
  </v-app>
</div><div id="app">
  <v-app id="inspire">
    <h5>Selected: </h5>
    <v-data-table
      v-model="selected"
      :headers="headers"
      :items="desserts"
      item-key="name"
      show-select
      @click:row="handleClick"
      class="elevation-1"
    >
     
    </v-data-table>
  </v-app>
</div>



Kbc lottery winner registration-kbc jio lottery 2022-kbc jio lottery winner registration

Jio lottery winner |check kbc lottery winner number

Kbc company has been introduced new toll free number where every check lottery number and registration number by visiting.Now Its a very easy to verify fake and real number by following the directions of jio lottery winner and kbc check lottery number .If you want to jio lottery winner numbers ,you should put WhatsApp number and registered lottery number in required portal.Only real officer of kbc can provide you check lottery portal.Its a responsibility of jio sim lottery winners and kbc all India sim card Lucky draw winners to connect with jio kbc lottery winner online check,check kbc lottery winner online.Nowadays scammers are using fake online check lottery portal in order to make money.If you are receiving unknown details from mysterious callers and WhatsApp visitors,you should not be blind followers of these unknown guests.You will have to reach jio kbc lottery head office helpline number and jio lottery winner online check 2022.If you are responding to jio kbc regarding verification.Then Its a not easy to deceive you on the behalf of kbc check lottery online ,jio sim lottery winnee,jio kbc lottery winner registration,kbc lottery winner registration,kbc winner jio, jio winner kbc ,kbc jio winner list ,kbc jio lottery winner list and kbc jio Lucky draw winner competition.

https://sonywebkbc.comenter image description here




vendredi 29 juillet 2022

Iterate through selected checkbox | Oracle APEX |

I have a interactive grid with editing mode enabled which enables checkbox

I use APEX version : 20.x

Need :

When I select multiple check box I need to iterate through the selected checkbox one by one and get details and store into variable

My GUI GUI

I am good with python ... below is the logic need to be written in apex way

while i in IRreport  
do  
    if checkbox = true then

         fstname = IRreport(i)[firstname]
         lstname  = IRreport(i)[lastname]
         insert into emp values (fstname,lstname); 

    else
         null;
    end if;

done 

Expected Output : In my emp table

Lastname  , Firstname 
King      , Stevens
Kochhar   , Neen
Partners  , karen
Hartstein , Michael



mercredi 27 juillet 2022

Does Azure Form Recognizer 3.0 or 4.0 support key-value pairs for questions and checkboxes in surveys?

I know since version 2.1 released, Form Recognizer now supports checkbox, selection mark, and radio button detection. Using C#, I am trying to extract survey data out from a lot of different applications. The only downside is I do not know how many different templates exist for these applications. Form Recognizer does a good job of recognizing question and answer pairs as long as there are no checkboxes associated with them. For the checkboxes, both prebuilt templates "general-document" and "layout" can handle checkbox detection. However, it only marks the state of the checkbox as "selected" or "unselected". I need the JSON output to combine the checkbox state with the question and answer value that it is associated with. Right now, having the checkbox states alone do not provide any value as I do not know what the answer is attached to. As you can imagine, there are a lot of questions with checkbox answers. It would be very difficult to track which checkbox is associated with which question in the JSON output. Is there any workaround to give a key-value pair output for questions and checkbox answers?

I will show a random example of the survey questions here for further clarification. On the actual application (which I can't show for privacy), they are real checkboxes. For this example, these numbers are made up:

"Do you like ice cream?" YES[•] NO[]

"If you answered yes to the previous questions, what flavor do you like?" VANILLA[] CHOCOLATE[•] OTHER[]

The output looks something like this:

"selectionMarks": [
  {
    "state": "selected",
    "polygon": [
      217,
      862,
      254,
      862,
      254,
      899,
      217,
      899
    ],
    "confidence": 0.995,
    "span": {
      "offset": 1421,
      "length": 12
    }
  },
  {
    "state": "unselected",
    "polygon": [
      225,
      868,
      257,
      868,
      257,
      899,
      225,
      899
    ],
    "confidence": 0.995,
    "span": {
      "offset": 1421,
      "length": 12
    }
  },

etc.




iTextSharp: Add checkbox inside table cell with text

I want to add two checboxes inside an itexsharp cell on a table. But I don't know how to do it. The check box must NOT be editable. They need to be generated from code, based on user data on DB to check the yes option or the no option.

enter image description here

I try this:

String FONT = "C:\\Windows\\Fonts\\wingding.ttf";
string checkBox = "\u00fe";
string uncheckBox = "o";
BaseFont bf = BaseFont.CreateFont(FONT, BaseFont.IDENTITY_H, BaseFont.EMBEDDED);
Font f = new Font(bf, 12);
Paragraph p = new Paragraph("YES" + checkBox + "\n" + "NO" + uncheckBox, f);

cell = new PdfPCell(p);
table.AddCell(cell);

It works good without the YES and NO text, if I only put both textboxes it workd good. The problem is when I write "YES" + checkbox, because it generate an extrange icon. Any solution?




Putting checkbox values into a txt file using PHP

<input id="c1"type="checkbox" name="cq1" value="value1" >


extract($_REQUEST);
$file=fopen("standard.txt","a");

fwrite($file, "Value: \n");

if ($_GET['cq1'] == 'value1') {
    fwrite($file,"Done\n");
    }

fclose($file);
    

I've been trying to get my checkbox values into a txt file but I think somethings wrong with my if statment and I can't find the problem. All the other fwriting works but I think it's something with my checkboxes.




Xamarin.Forms: Tapped event on CheckBox control

Is there a way to recognize something like Tapped event on the CheckBox control? CheckedChanged event is also triggered at the creation of the container (in my case a CollectionView) and at the scroll too, instead I need to manage the change of state only at the user's tap. Any tricks?




lundi 25 juillet 2022

I tried making a styled checkbox but only works when i use Position: absolute in css but the problem is, it makes it should move when scrolling scroll

I tried making a styled checkbox but only works when i use Position: absolute in css but the problem is that it makes it should move with the screen when scrolling instead of staying in one place like a regular checkbox The code is down bellow with the HTML "AND" the CSS i really appreciate you trying to help if you did

When i change the positioning the checkbox gets squished and hideous looking

  background-color: #f3f3f3;
}

.bg-container {
  
  top: 20%;
  width: 100%;
}

#_checkbox {
  display: none;
}

label {
  position: absolute;
  top: 7rem;
  right: 0px;
  left: 0px;
  width: 20px;
  height: 20px;
  margin: 0 auto;
  background-color: #f72414;
  transform: translateY(-50%);
  border-radius: 50%;
  box-shadow: 0 7px 10px #ffbeb8;
  cursor: crosshair;
  transition: 0.2s ease transform, 0.2s ease background-color,
    0.2s ease box-shadow;

  border: 2px solid rgba(0, 0, 0, 0.44);
}

label:before {
  content: "";
  position: absolute;
  top: 50%;
  right: 0;
  left: 0;
  width: 10px;
  height: 10px;
  margin: 0 auto;
  background-color: #fff;
  transform: translateY(-50%);
  border-radius: 50%;
  box-shadow: inset 0 7px 10px #ffbeb8;
  transition: 0.2s ease width, 0.2s ease height;

}

label:hover:before {
  width: 1px;
  height: 1px;
  box-shadow: inset 0 7px 10px #ff9d96;
}

label:active {
  transform: translateY(-50%) scale(0.9);
}



#_checkbox:checked + label {
  background-color: #07d410;
  box-shadow: 0 7px 10px #92ff97;
}

#_checkbox:checked + label:before {
  width: 0;
  height: 0;
}
  <form>
        
    <input type="checkbox" id="_checkbox">
    <label for="_checkbox">
      <div id="tick_mark"></div>
    </label>
</form>



VBA IE check and uncheck the checkbox with same-name and different-values "document of object iwebbrowser2 failed" error

As you can see i tried many different codes but i'm still getting "document of object iwebbrowser2 failed" error and i have no idea why please help

My HTML Code

<tr>
        <td width="4%" align="left" valign="middle"></td> 
        <td width="96%" align="left" valign="middle"><font face="arial" size="1.5">
            <input align="top" type="checkbox" name="R_CustInst" value="51">
<b>BANK2</b></font></td>
    </tr>
<tr>
        <td width="4%" align="left" valign="middle"></td> 
        <td width="96%" align="left" valign="middle"><font face="arial" size="1.5">
            <input align="top" type="checkbox" name="R_CustInst" value="52">
<b>BANK1</b></font></td>
    </tr>

My VBA Code

Sub test()

Set sht = ThisWorkbook.Sheets("Sheet1")
Dim IE As Object
Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = True
IE.Navigate "http://"

Do
If IE.ReadyState <> 4 Then
IE.Visible = True
Exit Do
Else
DoEvents
End If
Loop

'Dim chBox As Object
'
'    Set chBox = IE.document.getElementsByName("R_CustInst")
'
'    chBox(52).Checked = True
IE.document.querySelector("[name=R_CustInst][value='52']").Click

'IE.document.getElementsByAll("[name=R_CustInst][value=52]").FireEvent
'<input align="top" type="checkbox" name="R_CustInst" value="52">
'IE.document.all("R_CustInst")(52).Checked = True
'IE.document.getElementsByTagName("BANK1").Click
'IE.document.getElementsByValue("52")
'IE.document.getElementByAttribute("Type").Click
'IE.document.getElementById("Type").Click

Set IE = Nothing

End Sub

i'm new to this and i'm a mess been at it long and i give up Please help PLEASE!




Facebook Checkbox App in development mode requires advanced permissions for test messaging app admin - checkbox does not render at all

I am setting up a simple Facebook App following the Facebook Checkbox implementation guide (https://developers.facebook.com/docs/messenger-platform/discovery/checkbox-plugin/).

The goal obviously is to gather opt-ins from a simple HTML form. The problem is that even though I am logged in with the app admin account, the checkbox plugin fails to render with the following error message:

"Your app does not have the permission to message the user. Before approved for pages_messaging permission by App Review, you can only message people who have roles on the app."

I am sure that the frontend is correct, as I have tried swapping the appId and pageId from a working third party implementation and the error still occurs.

I cannot request an App Review, as I have no way of showcasing the app functionality without the checkbox rendering, nor is the development finalized.

The webhooks are set up correctly (tested with the dummy request). The app is added to a page, subscribed to opt-ins, and has standard pages_messaging permissions.

Can anyone see what might be missing?

Thanks, George




Checkboxes with react and MUI

I have 2 checkboxes, at the moment when one is selected both of when select. I want to be able to select one or both or none. I am not sure why the are both being selected at the same time.

These are my checkboxes

 ``` <FormControlLabel
      control={<Checkbox checked={checked} onChange={handleChange} color="primary"    />}
      label="Domain DNC file (Check if no list is required)"
    /> 

    <FormControlLabel
      control={<Checkbox checked={checked} onChange={handleChange} color="primary"    />}
      label="Email DNC file (Check if no list is required)"
    /> 


This is my onChange:

         const handleChange = (event) => {
          setChecked(event.target.checked);
         };


And this is my state:

    const [checked, setChecked] = React.useState(true);



How to override the checkbox checked property

In the JavaScript page I have three checkboxes - 1, 2 and 3 of which the 1st box is always checked (I used checked="checked") on page load. If the user uncheck the 1st box, check 2nd and 3rd box and save. Now on page load the 2nd and 3rd box should only be checked. How can I achieve this? I am new to JavaScript. Thanks




dimanche 24 juillet 2022

Trying to have a checkbox automatically check 2 other checkboxes

I'm very new to coding in java... So I apologize for the seemingly simple question.

However, In an Adobe PDF Form, I have a list of seven checkboxes, and when I select checkbox 2,3,or 4 I would like two other checkboxes to either be highlighted or selected.

So if Box B "r2w_att_B" is checked then "r2w_min_cond1" and "r2w_min_cond2" should both be checked. and if the form filler decides to check those boxes before selecting B,C or D then nothing should change. basically it is to ensure that you can't select B,C or D and "forget" to select the 2 minimum conditions.

and the same would be true for box C and D, so in theory the code should be the same with the exception of name of the initial box, I've used this line from another part of the form and it worked. so I could use that again. [if (event.target.value == "Yes")]

I have no idea how to write this... and the other code snippets I came across, I don't quite understand and cant make them work. I did piece together a clip of functional code, that on "mouse up" a checkbox triggers a textbox to copy "value" to another text box.

I appreciate anyone and everyone's guidance as I start learning a Java




samedi 23 juillet 2022

How can I get the value of checked (checkbox) and autocomplete a textInput in react native

could you help me?, I'm developing with react native and typescript, I need to do this: I have a checkBox that tells the user to check if his name is the same as his credit card, if he clicks the checkbox, a TextInput with his name is autocompleted, if you don't click the checkbox that he can type his name. I have a variable like: user_name I don't have code because I don't know how to do it, but I think it goes something like this:

 const [checked, setChecked] = useState(false)
...
return(
            <CheckBox
              checked={setChecked}
              onPress={}
              checkedIcon='dot-circle-o'
              uncheckedIcon='circle-o'
              checkedColor='blue'
              uncheckedColor='blue'
            />


        <TextInput
          placeholder='Nombre completo'
          value={}
          onChangeText={}
)



vendredi 22 juillet 2022

HTML Checkboxes not displaying correctly on different browsers

I have this data entry form that uses checkboxes but depending on the browser it displays differently. For example, on Google Chrome it does not allow you to check the boxes meanwhile on Microsoft Edge it works perfectly fine. I know it's a CSS issue but not sure how to fix this.

Website: http://54.242.194.165/experience.html

CSS

/* Forms */

    form label {
        display: block;
        font-weight: 800;
        margin: 0 0 1em 0;
        font-size: 0.8em;
        color: #444;
    }

    form input[type="text"],
    form input[type="email"],
    form input[type="tel"],
    form input[type="checkbox"],
    form input[type="date"],
    form input[type="checkbox"],
    form input[type="password"],
    form select,
    form textarea {
        -webkit-appearance: none;
        display: block;
        width: 100%;
        border-radius: 8px;
        border: solid 1px #eee;
    }

        form input[type="text"]:focus,
        form input[type="email"]:focus,
        form input[type="checkbox"]:focus,
        form input[type="tel"]:focus,
        form input[type="checkbox"]:focus,
        form input[type="date"]:focus,
        form input[type="password"]:focus,
        form select:focus,
        form textarea:focus {
            border-color: #0090c5;
        }

    form input[type="text"],
    form input[type="email"],
    form input[type="checkbox"],
    form input[type="tel"],
    form input[type="date"],
    form input[type="password"] {
        line-height: 3em;
        padding: 0 1em;
    }

    form select {
        line-height: 3em;
        padding: 0 1em;
    }

    form textarea {
        min-height: 9em;
        padding: 1em;
    }

    form ::-webkit-input-placeholder {
        color: #555 !important;
    }

    form :-moz-placeholder {
        color: #555 !important;
    }

    form ::-moz-placeholder {
        color: #555 !important;
    }

    form :-ms-input-placeholder {
        color: #555 !important;
    }

    form ::-moz-focus-inner {
        border: 0;
    }


 .testbox {
      display: flex;
      justify-content: center;
      align-items: center;
      height: inherit;
      padding: 3px;
      }
      form {
      width: 100%;
      padding: 20px;
      background: #fff;
      box-shadow: 0 2px 5px #ccc; 
      }
      input, select, textarea {
      margin-bottom: 10px;
      border: 1px solid #ccc;
      border-radius: 3px;
      }
      input {
      width: calc(100% - 10px);
      padding: 5px;
      }
      select {
      width: 100%;
      padding: 7px 0;
      background: transparent;
      }
      textarea {
      width: calc(100% - 6px);
      }
      .item {
      position: relative;
      margin: 10px 0;
      }
      .item:hover p, .item:hover i {
      color: #095484;
      }
      input:hover, select:hover, textarea:hover, .preferred-metod label:hover input {
      box-shadow: 0 0 5px 0 #095484;
      }
      .preferred-metod label {
      display: block;
      margin: 5px 0;
      }
      .preferred-metod:hover input {
      box-shadow: none;
      }
      .preferred-metod-item input, .preferred-metod-item span {
      width: auto;
      vertical-align: middle;
      }
      .preferred-metod-item input {
      margin: 0 5px 0 0;
      }
      input[type="date"]::-webkit-inner-spin-button {
      display: none;
      }
      .item i, input[type="date"]::-webkit-calendar-picker-indicator {
      position: absolute;
      font-size: 20px;
      color: #a9a9a9;
      }
      .item i {
      right: 1%;
      top: 30px;
      z-index: 1;
      }
      [type="date"]::-webkit-calendar-picker-indicator {
      right: 0;
      z-index: 2;
      opacity: 0;
      cursor: pointer;
      }
      .btn-block {
      margin-top: 20px;
      text-align: center;
      }
      button {
      width: 150px;
      padding: 10px;
      border: none;      
      -webkit-border-radius: 5px; 
      -moz-border-radius: 5px; 
      border-radius: 5px; 
      background-color: #095484;
      font-size: 16px;
      color: #fff;
      cursor: pointer;
      }
      button:hover {
      background-color: #0666a3;
      }
      @media (min-width: 568px) {
      .name-item, .city-item {
      display: flex;
      flex-wrap: wrap;
      justify-content: space-between;
      }
      .name-item input, .city-item input {
      width: calc(50% - 20px);
      }
      .city-item select {
      width: calc(50% - 8px);
      }
      }
        input[type="date"]::before {
          content: attr(placeholder);
          position: absolute;
          color: #999999;
        }

        input[type="date"] {
          color: #ffffff;
        }

        input[type="date"]:focus,
        input[type="date"]:valid {
          color: #666666;
        }

        input[type="date"]:focus::before,
        input[type="date"]:valid::before {
          content: "";
        }
        input[type="checkbox"] {
            appearance: checkbox !important;
        }



jeudi 21 juillet 2022

How to uncheck dynamic checkbox using Selenium Java

I have month dropdown where all the month that appears in the dropdown will be selected by default. The question is, I want only 2050-Jan month checkbox to remain checked and want the other month checkbox to be unchecked. Please note that the Year and Month is Dynamic. i.e. if the dropdown has 3 options displayed then the same dropdown can have 2 options displayed or could have more than 3 options displayed. But the only thing is the Year and month 2050-Jan alone should remain to be unchecked.

So this being the case how do I uncheck the other two or more checkbox.

Automating in Java selenium any leads will be very helpful.

For now if you see the below dropdown has 3 month and Year option selected by default of which I would need only 2050-Jan to remain unchecked.

This is a dynamic dropdown where the Year and Month will change but 2050-Jan will always be there but cant say if this will come as 3rd option always

enter image description here

HTML:

<mat-option _ngcontent-vor-c141="" role="option" class="mat-option mat-focus-indicator mat-option-multiple ng-tns-c92-121 ng-star-inserted mat-selected mat-active" id="mat-option-370" tabindex="0" aria-selected="true" aria-disabled="false" style="">
    <mat-pseudo-checkbox class="mat-pseudo-checkbox mat-option-pseudo-checkbox ng-star-inserted mat-pseudo-checkbox-checked"></mat-pseudo-checkbox>
    <!---->
    <span class="mat-option-text">2022-Apr</span>
    <!---->
    <div mat-ripple="" class="mat-ripple mat-option-ripple"></div>
</mat-option>

Dropdown List HTML:

<div class="mat-select-arrow-wrapper ng-tns-c92-121">

<div class="mat-select-arrow ng-tns-c92-121"></div></div>

HTML after unselecting the checkbox with April 2022:

<mat-option _ngcontent-vor-c141="" role="option" class="mat-option mat-focus-indicator mat-option-multiple ng-tns-c92-121 ng-star-inserted mat-active" id="mat-option-370" tabindex="0" aria-selected="false" aria-disabled="false" style="">
    <mat-pseudo-checkbox class="mat-pseudo-checkbox mat-option-pseudo-checkbox ng-star-inserted"></mat-pseudo-checkbox>
    <!---->
    <span class="mat-option-text">2022-Apr</span>
    <!---->
    <div mat-ripple="" class="mat-ripple mat-option-ripple"></div>
</mat-option>



How do I fix a TypeError regarding a ViewChild element that actually works?

This is the HTML component where checkbox is

 <mat-checkbox class="dashboard-content-custom-select-option" id="dashboard-all-checkbox" #allSelector [indeterminate]="someCheckboxesActive()" [checked]="allCheckboxesActive()" (click)="toggleAllSelection($event)">Alle </mat-checkbox>
The Select all Mat-Checkbox is checked if all of the upper checkboxes are checked. It is also checked if clicked on while some checkboxes are left empty and all of them are checked.
export class DashboardContentComponent implements OnInit, AfterViewInit, OnDestroy {
  @ViewChild('dashboard-all-checkbox') allSelect: MatCheckbox;

toggleAllSelection(event) { // toggle checkbox is controlled from here
    console.log(this.allSelect);
    if ( event.currentTarget.id === 'dashboard-all-checkbox' && this.selectedValues.length === 6) {
      this.dashboardContentForm.get('dashboardContentValue').setValue([]); 
      this.allSelect.checked = false; // unchecks the checkbox
    } else if ( (this.selectedValues.length < 6  && event.currentTarget.id === 'dashboard-all-checkbox') )  {
      this.dashboardContentForm.get('dashboardContentValue').setValue(
         [ ...this.displayDashboardContentValues.map((dv) => dv.key), ...[0]]
      );
      this.allSelect.toggle(); //checks the checkbox
    }
  }
}
In this TS file, 6 upper checkboxes must all be active for the Select All checkbox to be active. Otherwise if less than 6 are active, it becomes indeterminate.

To be precise, everything works fine. However, the only problem is that I get TypeErrors although the checkbox does whatevery it is supposed to do. If checkbox's id is used, everything is fine(which is the only way that works here in my case). If I use the #allSelector, it is different. How do I prevent these errors from occuring? Besides, you can ignore the grey highlighting in the dropdown, it isn't relevant.

if the select all checkbox is clicked and checked enter image description here

enter image description here

if the select all checkbox is clicked and unchecked enter image description here

enter image description here




mercredi 20 juillet 2022

Pass children to checkbox item Antd

I'm having a checkbox group and I want each item in my checkbox has a button which looks like in my image. enter image description here

Here is my code and I don't know how to make the button appear. Need some help!! Thank you!

    const CheckboxGroup = Checkbox.Group;
    const plainOptions = ['Agence 1', 'Agence 2', 'Agence 3'];
    const defaultCheckedList = ['Agence 1', 'Agence 2', 'Agence 3'];
    
    const App: React.FC = () => {
      const [checkedList, setCheckedList] = useState<CheckboxValueType[]>(defaultCheckedList);
      const [checkAll, setCheckAll] = useState(false);
    
      const onChange = (list: CheckboxValueType[]) => {
        setCheckedList(list);
        setCheckAll(list.length === plainOptions.length);
      };
    
      const onCheckAllChange = (e: CheckboxChangeEvent) => {
        setCheckedList(e.target.checked ? plainOptions : []);
        setCheckAll(e.target.checked);
      };
    
      return (
        <>
          <Checkbox onChange={onCheckAllChange} checked={checkAll}>
            Check all
          </Checkbox>
          <CheckboxGroup options={plainOptions} value={checkedList} onChange={onChange} />
        </>
      );
    



How to Select All Checkboxes By ID

when user clicks check all first, second checkbox should be unchecked and vice versa, for now everything is checked. enter image description here

What I'm trying to do is get something to select all checkboxes. But what works is currently selected not all by id, I want to do it based on $item->payroll_group_id

my code in index.blade.php

     @foreach ($unit as $item)
          @if ($item->payroll_group_id == null || $item->payroll_group_id == $payroll_id)
                                <tr class='employee-row'>
                                    <td><input type="checkbox" class="emp-check" id="check" name="employee_id[]" value="">
                                    <input type="hidden" class="py-sid" value=""></td>
                                    <td class='captial'></td>
                                    <td class='captial'></td>
                                </tr>
              @endif
     @endforeach

Here is the javascript for this

<script>
    function toggle(source) {
        var checkboxes = document.querySelectorAll('input[id="check"]');
        for (var i = 0; i < checkboxes.length; i++) {
            if (checkboxes[i] != source)
                checkboxes[i].checked = source.checked;
        }
    }
</script

how to solve my problem please help me.




Facing issue on getting selected row records in mat - checkbox table in angular 9

I 'm Facing issue in case of fetching records of only selected checkbox row records in mat checkbox table in Angular 9.By check or uncheck of any record it gives total records instead of particular checkbox selected records. On Html file

<button mat-button class="btn order-secondery" (click)="exportPOErrorRecords()" [disabled]="isButtonEnable">
                    <mat-icon>save_alt</mat-icon>Export
                </button> 

On.ts file

exportPOErrorRecords() {
    this.isAllCheckFlag = 'N';
    if(this.isAllSelected()){
      this.isAllCheckFlag = 'Y';
    }
    this._vendorFileService.exportPoErrors(this.selection.selected,this.isAllCheckFlag)
      .subscribe(
        (response: HttpResponse<Blob>) => {
          let fileName = "vendorFileValidation.csv";
          let binaryData = [];
          binaryData.push(response);
          let downloadLink = document.createElement('a');
          downloadLink.href = window.URL.createObjectURL(new Blob(binaryData, { type: 'text/csv' }));
          downloadLink.setAttribute('download', fileName);
          document.body.appendChild(downloadLink);
          downloadLink.click();
        }
      )

  }
isAllSelected() {
    const numSelected = this.selection.selected.length;
    const numRows = this.dataSource.data.length;
    return numSelected === numRows;
  }

Have no idea why getting undefined this.selection.selected case.




mardi 19 juillet 2022

Ant Design/React - How to use checkboxes in a list?

I'm new to React and Ant Design.

I want to use a List that has a Checkbox for each item. As in the attached example:

  <Checkbox indeterminate={indeterminate} onChange={onCheckAllChange} checked={checkAll}>
    Check all
  </Checkbox>
  <Divider />
  <List
    dataSource={plainOptions}
    renderItem={value => (
      <CheckboxGroup options={plainOptions} value={checkedList} onChange={onChange} />
    )}
  />

https://codepen.io/antoinemy/pen/dymvwJG

However I would simply like to replace the CheckboxGroup with a Checkbox but I can't do it through the List.

Can someone show me a solution and explain to me?

I would like to eventually produce other things through this list. I'm not interested in the CheckboxGroup, I really want the List to deploy my items.

Thank you, Antoine (FR)




lundi 18 juillet 2022

Check all checkbox in table with pagination

I'm looking for a solution to check all checkbox of a table with pagination. I'm using laravel pagination :

$webclients = WebClient::orderBy('id', 'desc')->paginate(20);

But i encounter a problem :

The display page work good, but all the other rows on all other pages doesn't check. And if a i change the page, all checked checkboxes become uncheck.

I don't know if is exist a solution in javascript or in PHP with appends data ?

Can i get all the hidden node of a paginate table in Jquery or JS ?

Many thanks for the help !




Delphi FMX TStringgrid, draw a checkbox on a single cell

Hello I want to put a checkbox on a single cell (not a checkcolunn) of a FMX stringgrid. I think that I need to use 'StringGrid1.AddObject'but I do not know how to go from there. Help is very much apprecicated. Thanks Ad.




dimanche 17 juillet 2022

Checkbox is not working properly with React state

I am building a form where the hotel owners will add a hotel and select a few amenities of the same hotel. The problem is If I use state in the onChange function the checkbox tick is not displayed. I don't know where I made a mistake?

import React from "react";
import { nanoid } from "nanoid";

const ListAmenities = ({
  amenities,
  className,
  setHotelAmenities,
  hotelAmenities,
}) => {
  const handleChange = (e) => {
    const inputValue = e.target.dataset.amenitieName;
    if (hotelAmenities.includes(inputValue) === true) {
      const updatedAmenities = hotelAmenities.filter(
        (amenitie) => amenitie !== inputValue
      );
      setHotelAmenities(updatedAmenities);
    } else {
      //If I remove this second setState then everything works perfectly.
      setHotelAmenities((prevAmenities) => {
        return [...prevAmenities, inputValue];
      });
    }
  };

  return amenities.map((item) => {
    return (
      <div className={className} key={nanoid()}>
        <input
          onChange={handleChange}
          className="mr-2"
          type="checkbox"
          name={item}
          id={item}
          data-amenitie-name={item}
        />
        <label htmlFor={item}>{item}</label>
      </div>
    );
  });
};

export default ListAmenities;



How to stop transition when checkbox is unchecked javafx

So I've made a checkbox that applies a scale transition to a rectangle when checked. But the problem is that the transition keeps going even after I uncheck the checkbox. Any ideas on how to make it stop after un-checking?

checkbox.setOnAction(e -> {
            ScaleTransition scaleT = new ScaleTransition(Duration.seconds(5), rectangle);
            scaleT.setAutoReverse(true);
            scaleT.setCycleCount(Timeline.INDEFINITE);
            scaleT.setToX(2);
            scaleT.setToY(2);
            scaleT.play();
        });



DataGridView selected row to check a checkbox

I am currently trying to check a checkbox dependent of the SQL data after selecting the row in a datagridview.

I have gotten this to display text with TexBoxes, but cannot get it to check a check box.

Yes = True No = False

Any recommendations, would be very much appreciated.

                textBox4.Text = row.Cells[11].Value.ToString();  //other/notes
                textBox3.Text = row.Cells[3].Value.ToString();  //Monitor
                textBox1.Text = row.Cells[0].Value.ToString();  //Firstname
                textBox2.Text = row.Cells[1].Value.ToString();  //Surname
                comboBox1.Text = row.Cells[2].Value.ToString();  //Company
                comboBox3.Text = row.Cells[4].Value.ToString();  //Laptop/Nuc
                checkBox1. = row.Cells[5].Value.ToString();   //keyboard

enter image description here

enter code here



samedi 16 juillet 2022

Checkbox doesn't update attached property in ObservableCollection of objects

Model

    public class ThemeItem:BaseItem
    {
        [Ignore]
        public bool IsSelected { get; set; }
        public string Name { get; set; }
        public int NumberOfWords { get; set; }
    }

    public class BaseItem
    {
        [PrimaryKey, AutoIncrement]
        public int Id { get; set; } 
    }

View

<CollectionView ItemsSource="{Binding Themes}" SelectionMode="None">
                    <CollectionView.ItemTemplate>
                        <DataTemplate x:DataType="m:ThemeItem">
                            <Grid Padding="5"
                                  xct:TouchEffect.Command="{Binding Source={RelativeSource AncestorType={x:Type vm:ThemeItemsViewModel}},Path=ShowDetailsCommand}"
                                  xct:TouchEffect.CommandParameter="{Binding .}"
                                  xct:TouchEffect.LongPressCommand="{Binding Source={RelativeSource AncestorType={x:Type vm:ThemeItemsViewModel}},Path=SelectionCommand}"
                                  xct:TouchEffect.LongPressCommandParameter="{Binding .}">
                                <Frame BorderColor="LightGray" CornerRadius="5" Padding="15">
                                    <Grid>
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="auto"/>
                                            <ColumnDefinition Width="*"/>
                                            <ColumnDefinition Width="auto"/>
                                        </Grid.ColumnDefinitions>
                                        <CheckBox Grid.Column="0" IsChecked="{Binding IsSelected,Mode=TwoWay}" 
                                                  IsVisible="{Binding Source={RelativeSource AncestorType={x:Type vm:ThemeItemsViewModel}},Path=IsSelection}"/>
                                        <Label Grid.Column="1" Text="{Binding Name}" FontSize="Large"/>
                                    </Grid>
                                </Frame>
                            </Grid>
                        </DataTemplate>
                    </CollectionView.ItemTemplate>
                </CollectionView>

ObservableCollection

public ObservableCollection<ThemeItem> Themes { get; set; }

Command

        public AsyncCommand DeleteSelectedCommand { get; set; }
        private async Task OnDeleteSelectedCommandExecuted()
        {
            IsBusy = true;
            bool delete = await App.Current.MainPage.DisplayAlert("Delete", "Are you sure you want to delete selected themes and words it contains?", "Yes", "No");
            if(true)
            {
                foreach (ThemeItem t in Themes.Where(t=>t.IsSelected))
                {
                    await _themeDataService.DeleteItemAsync(t.Id);
                }
                await LoadList();
            }
            IsBusy = false;
        }

I'm building dictionary app with xamarin.forms. I have a list of themes, each theme has a checkbox that is binded to "IsSelected" property. After I select theme I want to push button and delete it with DeleteSelectedCommand command, but when I put a tick in checkbox, property "IsSelected" doesn't update though I use TwoWay mode. [Ignore] tag is for SqLite.




vendredi 15 juillet 2022

How to operate checkbox with keydown property?

I want to tick the checkbox when enter pressed and output should be display in line tag similarly after pressing backspace checkbox should be unticked and element must remove from line. but how can i do that? without using jquery.

<!DOCTYPE html>
<html>
    <head>
        <title>Checkbox Attandance</title>
        <style>
            li {
            max-width: 800px;
            word-wrap: break-word;
            font-size: 27px;
            margin-left: 200px;
                color: blue;
                margin-top: 100px;
        }

        h1{
            color: crimson;
            font-weight: 1000px;
            font-size: 60px;
            margin-left: 500px;;
            
        }
        </style>  
    </head>
    <body style="background-color: blanchedalmond;" >
        <h1>Attendance</h1>
        <li id="dis">Present Students<br></li><br>
        

     <script>
         for(i=301;i<359;i++){
         document.write("<input type='checkbox' value='"+i+"' onkeydown='absent(this)'>"+i+"<br>");
         }
         function absent(e){
            if(event.key=="Enter"){
            e.checked=true;
            document.getElementById("dis").innerHTML+=" "+e.value;
             
            }
            
            if(e.key=="Backspace"){
                e.checked=false;
               var x=document.getElementById("dis").innerHTML;
               var m=x.replace(e.value,"")
                document.getElementById("dis").innerHTML=m;
             
            }

            
         }
     </script>
    </body>
</html>



Android Checkbox weird behavior (becomes disabled and clickable after bringing fragment from backstack)

I am currently facing an issue using CheckBox in my fragment. Once the fragment is opened, the checkbox works properly. The check box's behavior changes in two case:

  • When I bring the fragment from the backStack using Back button
  • When I open the fragment for the second time.

I t seems like when the fragment is reCreated, the checkBox becomes gray (disabled) and still clickable.

<androidx.appcompat.widget.AppCompatCheckBox
            android:id="@+id/checkbox"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:checked="true"
            app:layout_constraintTop_toBottomOf="@id/ivLogo"
            app:layout_constraintStart_toStartOf="@id/guideStart"
            app:layout_constraintEnd_toEndOf="@id/guideEnd"/>

I tried to save its state but didn't work.

PS: After getting this behavior, (checkbox.isEnabled = true) doesn't work anymore.

Any help ?

Thanks in advance.




Validate a dynamically generated CheckBox

I'm generating an asp:CheckBox dynamically and I need to validate that it is checked with a CustomValidator().

private void AddCheckBox(HtmlGenericControl newDiv, AdditionalFields field)
    {
        var additionalFieldDiv = new System.Web.UI.HtmlControls.HtmlGenericControl("DIV");
        additionalFieldDiv.Attributes.Add("class", "additional-field-row");


        var additionalLabel = new RadLabel();
        additionalLabel.Text = field.Label;
        additionalLabel.ID = "AdditionalLabel" + field.ControlId;
        additionalLabel.CssClass += "title ";
        additionalLabel.Width = new Unit(field.LabelWidth ?? 175);
        if (field.Required??false) additionalLabel.CssClass += "additional-field-required";

        var additionalField = new System.Web.UI.WebControls.CheckBox();
        additionalField.ID = "AdditionalField" + field.ControlId;
        
        additionalField.CssClass += "additional-field-checkbox";
        additionalField.Width = new Unit(field.Width ?? 200);


        var customValidator = new CustomValidator();
        customValidator.ID = "CustomValidator" + field.ControlId;
        //customValidator.ClientValidationFunction = "CheckBoxValidation(AdditionalField"+ field.ControlId +")";
        customValidator.ControlToValidate = "AdditionalField" + field.ControlId;
        customValidator.ErrorMessage = string.IsNullOrEmpty(field.ErrorMessage) ? field.Label + " required" : field.ErrorMessage;
        customValidator.CssClass += "additional-fields-validator";
        customValidator.Display = ValidatorDisplay.Dynamic;
        customValidator.ValidationGroup = "valGroup";
        customValidator.EnableClientScript = true;

        newDiv.Controls.Add(additionalFieldDiv);
        additionalFieldDiv.Controls.Add(additionalLabel);
        additionalFieldDiv.Controls.Add(additionalField);

        if (field.Required ?? false)
        {
            additionalFieldDiv.Controls.Add(customValidator);
        }

    }

I get an error if I try to use customValidator.ControlToValidate = "AdditionalField" + field.ControlId;

Control 'AdditionalField9' referenced by the ControlToValidate property of 'CustomValidator9' cannot be validated.

I have several other controls on the page that are in the validation group "valGroup" and I like the CheckBox validated client side. If I can't use the ControlToValidate property do I need to use JavaScript, and if so how do I pass the ID of the CheckBox to validate?

 <script type = "text/javascript">
    function ValidateCheckBox(sender, args) {
        if (document.getElementById("<%=AdditionalField9.ClientID %>").checked == true) {
            args.IsValid = true;
        } else {
            args.IsValid = false;
        }
    }
</script>

Hope you can help




jeudi 14 juillet 2022

Angular 2 checkbox to select all works but doesnt mark checkboxes

i've been using this implementation before and it worked, but i had to export whole logic to a service and now the toggleAll doesnt really work. It pushes every selected object to an array but checkboxes arent getting checked.

Checkbox-service logic:

    if(event.checked){
      this.selectedUsers.push(item);
    } else {
      const index = this.selectedUsers.indexOf(item);
      if(index >= 0){
        this.selectedUsers.splice(index, 1);
      }
    }
  }
  
  exists(item){
    return this.selectedUsers.indexOf(item) != -1;
  }
  
  isIndeterminate(){
    return (this.selectedUsers.length > 0 && !this.isChecked());
  }
  
   isChecked(){
     return this.selectedUsers.length === this.users.length;
    }
    
    toggleAll(event: MatCheckboxChange){
      if (event.checked){
        this.selectedUsers.length = 0;
        this.users.forEach(row=> {
          this.selectedUsers.push(row);
        })
      } else {
        this.selectedUsers.length = 0;
      }
    }

In my component im just returning every method

 getCheckboxData(){
    return this.checkboxDataService;
  }

Fragment of template with master-checkbox:

<button mat-raised-button (click)="onButtonClick()">Odśwież</button>
<div class="container" #loaded>
    <div class="row">
        <div class="col">
            <p>
                <mat-checkbox [checked]="getCheckboxData().isChecked()"
                [indeterminate]="getCheckboxData().isIndeterminate()"
                (change)="getCheckboxData().toggleAll($event)"
                ></mat-checkbox> Nazwa zadania</p>

And template with rest of the checkboxes:

<div class="container" *ngFor="let user of users">
        <div class="row">
            <div class="col">
                <mat-checkbox (click)="$event.stopPropagation()"
                (change)="$event ? getCheckboxData().toggle(user, $event) : null" 
                [checked]="getCheckboxData().exists(user)"></mat-checkbox>

Had to use service since i need to stream array with checked items to a different component.




React Native Expo checkbox select between values

I am having problems with selecting between two values in the checkbox. It only works when I make click on Celsius. I don't know what I am doing wrong, can someone assist me with this.

I am not getting any error both as web app or phone app. I only need to make it possible to work when I click on the checkbox that the user selects.

        import React, { useState } from 'react';
        import { StyleSheet, View, Text, TouchableOpacity } from 'react-native';
        import Checkbox from 'expo-checkbox';
        
        const Settings = () => {
        
            const [isChecked, setChecked] = useState();
        
            function tempUnit(isChecked) {
                if (isChecked) {
                    return (
                        <TouchableOpacity>
                            <View style={styles.checkboxVariables}>
                                <Checkbox
                                    value={true}
                                    onValueChange={setChecked}
                                /><Text style={styles.checkboxVariable}>Celsius</Text>
                                <Checkbox
                                    value={false}
                                    onValueChange={setChecked}
                                /><Text style={styles.checkboxVariable}>Fahrenheit</Text>
                            </View>
                        </TouchableOpacity>
                    )
                } else {
                    return (
                         <TouchableOpacity >
                            <View style={styles.checkboxVariables}>
                                <Checkbox 
                                value={false} 
                                onValueChange={setChecked} 
                                /><Text style={styles.checkboxVariable}>Celsius</Text>
                                <Checkbox
                                value={true} 
                                onValueChange={setChecked} 
                                /><Text style={styles.checkboxVariable}>Fahrenheit</Text>
                            </View>
                        </TouchableOpacity>
                    )
                }
            }
        
            return (
        
                <View style={styles.container}>
        
                    <Text style={styles.containerTitle}>Application Settings</Text>
        
                    <Text style={styles.settingsTitle}>Temperature Unit</Text>
                    <TouchableOpacity>
                       {tempUnit(isChecked)}
                    </TouchableOpacity>
               
                </View>
            )
        }
        
        const styles = StyleSheet.create({
            container: {
                alignItems: 'center',
                justifyContent: 'center',
            },
            containerTitle: {
                fontWeight: 'bold',
                fontSize: 40,
                paddingTop: 50,
                color: '#51697f',
            },
            settingsTitle: {
                paddingTop: 20,
                fontStyle: 'italic',
            },
            checkboxVariables: {
                flexDirection: "row",
                marginBottom: 10,
                padding: 10,
            },
            checkboxVariable: {
                marginRight: 30,
            }
        });
        
        export default Settings;



mercredi 13 juillet 2022

How to display more then one month result?

I want to display several months at once. Currently showing only one month. When I try to select multiple months, it only shows one. What could be wrong with my code? Thank you very much for the reply.

Here is my code:

for($i=1;$i<=30;$i++){
    $place_of_counselling=get_field('noustamise_koht'.$i.'',$post->ID);
    $date=date_create(get_field('noustamise_kuupaev'.$i.'',$post->ID));
    if(date('m')!= date_format($date,"m") && !isset($_POST['month'])){
        continue;
    }elseif($_POST['month'] != date_format($date,"m")){   
        continue;
    }

and the form code:

<form action="" method="post">
                        <input type="checkbox" id="01" name="month" value="01">
                        <label for="01">Jaanuar</label><br>
                        <input type="checkbox" id="02" name="month" value="02">
                        <label for="02">Veebruar</label><br>
                        <input type="checkbox" id="03" name="month" value="03">
                        <label for="03">Märts</label><br>
                        <input type="checkbox" id="04" name="month" value="04">
                        <label for="04">Aprill</label><br>
                        <input type="checkbox" id="05" name="month" value="05">
                        <label for="05">Mai</label><br>
                        <input type="checkbox" id="06" name="month" value="06">
                        <label for="06">Juuni</label><br>
                        <input type="checkbox" id="07" name="month" value="07">
                        <label for="07">Juuli</label><br>
                        <input type="checkbox" id="08" name="month" value="08">
                        <label for="08">August</label><br>
                        <input type="checkbox" id="09" name="month" value="09">
                        <label for="09">September</label><br>
                        <input type="checkbox" id="10" name="month" value="10">
                        <label for="10">Oktoober</label><br>
                        <input type="checkbox" id="11" name="month" value="11">
                        <label for="11">November</label><br>
                        <input type="checkbox" id="12" name="month" value="12">
                        <label for="12">Detsember</label><br>
                    
                        <input type="submit" value="Otsi" name="submitbutton" >
                </form>



mardi 12 juillet 2022

Populate textarea if checkbox is checked

I'm using this to populate a textarea with value if a checkbox is checked:

$('#checkbox_a').change(function(){
    $("#textarea_b").text("");
    if ($('#checkbox_a').is(':checked')) { 
        $("#textarea_b").text("Yes"); 
    }
});

The problem I'm having is that if a user already inputs something in the textarea, decides to delete his input again and marks the checkbox afterwards it won't get populated anymore.

Can you help me with that?




lundi 11 juillet 2022

Copying a row with ActiveX checkboxes and pasting onto row above

I have a table filled with activeX checkboxes that are each linked to their respective cells.

After clicking on a certain button, a new empty row is added above the last row (using: Range("xxx").EntireRow.Insert) .

What I want to achieve is copying and pasting the last filled row into the above 'new' row and then clearing the final row so it is the new 'entry row' with empty checkboxes.

I have tried copying and pasting with formatting etc but just cant seem to copy over the checkboxes.enter image description here

Any ideas?




Blazor server C#

I am writing a code to send an email with the attached photos. I upload the photos but I want to choose some of them to send by using the checkbox. Can anyone help me, please? This is my code that sends all the photos together.

enter code here

<MudTextField @bind-Value="mod.ReceiversAddress" Label="TO" Variant="Variant.Outlined" Class="mt-10">

   <MudGrid Class="d-flex justify-center flex-grow-1 gap-4">    <MudItem xs="12" sm="6" md="4">
   <MudTextField @bind-Value="mod.subject" Label="Subject" Variant="Variant.Outlined"></MudTextField>
   </MudItem> </MudGrid> <MudGrid Class="d-flex justify-center flex-grow-1 gap-4">
<MudItem xs="12" sm="6" md="4"> <MudTextField T="string" @bind-Value="mod.body" Label="Message" Variant="Variant.Outlined"    Lines="10" /> </MudItem> </MudGrid>
   <MudGrid Class="d-flex justify-center flex-grow-1 gap-4"> <MudButton    Variant="Variant.Filled" EndIcon="@Icons.Material.Filled.Send"    Color="Color.Primary" OnClick="Send" Class=" mt-10    mb-10">Send</MudButton> </MudGrid>
   @foreach (var rose in test){
<MudImage Src="@rose" Width="100" Height="100" Alt="flowers" Elevation="25" Class="mx-auto"/>
 <MudCheckBox @bind-Checked="@Dense_CheckBox" Dense="true" Color="Color.Success"></MudCheckBox>
  }  
   <MudGrid Class="d-flex justify-center flex-grow-1 gap-4"> <MudButton    Variant="Variant.Filled" EndIcon="@Icons.Material.Filled.Send"    Color="Color.Primary" OnClick="Attachment"    Class="mt-10">Attachment</MudButton> </MudGrid>


   @code {

   protected override void OnInitialized()    {
   Remove();    }
   string[] flowers = Directory.GetFiles("wwwroot\\sss");

   List<string> test = new();

   EmailModel mod = new EmailModel();
   public void Send()    {

   SendingEmail.SendEmail(mod);
   }
   public bool Dense_CheckBox { get; set; } = true;


   public void Attachment()    {


   SendingEmail.AtachFile(mod);
   }    //images array to display just sss from the path    string[] path= Directory.GetFiles("wwwroot\\sss");

   public void Remove()    {
   foreach( var item in path)
   {
       var y = item.Remove(0, 8);
       test.Add(y);
       

   }    }



(Checkbox and Textbox) How to get the quantity from the textbox and output the name of the checkbox and the quantity we get from the textbox (C#)

enter image description hereI wanted to create a dynamic way to get the value of a textbox and checkbox...then put those values as an output in a label. I tried to use the foreach() in my tabPage3.Controls and it works for the checkbox but when I try to use it for the textbox it didn't work and I assumed it's because the checkbox is not the parent of the textbox, I just put the textbox over the checkbox as you can see in the picture. So how can I make those to control connect somehow or work around them?enter image description here enter image description here




dimanche 10 juillet 2022

how to add checkbox in this table in kivy python?

i created a table in kivy and python and i need to change a checkbox word in dict with the CheckBox() widget how can i make it ?

this my code


data = {'CheckBox': {} , 'Id' : {} , 'Items' :{} , 'QTY' :{}, 'Price' :{}, 'Client_name'  :{}, 'Total_price' :{}} 




Checkboxes not clearing visually [duplicate]

I'm trying to clear some checkboxes using a button that calls a function to reset them (see snippets from jsfiddle below).

Visually, the forms are not 'unchecked', but they need to be clicked twice to change the valie again - which made me think it's just a display issue. So I tested in jsfiddle here and I can see the before and after results of running the reloadForm function - the checkboxes are 'unchecked' (the value of checked is false), but they 'look' checked.

I've tried a few variations of unchecking the boxes, but they all get the same result.

Pretty certain this is a specific jquery issue - the code snippets below work fine here, but in jsfiddle (or my actual app) they don't.

function reloadForm(clear) {
  //clear the form
  $('#descriptionTxt').val('');
  $("input[type='checkbox']").prop('checked', false);
}
<link href="https://ajax.googleapis.com/ajax/libs/jquerymobile/1.4.5/jquery.mobile.min.css" rel="stylesheet" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div id="reloadBtn" style="padding:20px">
  <button onclick="reloadForm(true)">Reset Form</button>
</div>
<fieldset id="checkRowstudents1" class="ui-grid-a">
  <div id="checkRowstudents1-a" class="ui-block-a">
    <label for="learnerstudents0">ari</label>
    <input type="checkbox" name="learner" id="learnerstudents0" value="ari" data-mini="true" >
  </div>
  <div id="checkRowstudents1-b" class="ui-block-b">
    <label for="learnerstudents1">dominic</label>
    <input type="checkbox" name="learner" id="learnerstudents1" value="dominic" data-mini="true">
  </div>
</fieldset>

<label for="descriptionTxt" class="ui-hidden-accessible">Description:</label>
<input type="text" name="descriptionTxt" id="descriptionTxt" placeholder="Description" value="">



samedi 9 juillet 2022

Adding checkboxes from an ini file

I have an ini file with something like the following:

[tweaks]
Tweak 1=tweak1.bat
Tweak 2=tweak2.bat
Tweak 3=tweak3.bat

I can read it easily enough with:

local $tweaks = IniReadSection(@ScriptDir & "\bats\tweakit.ini","Tweaks")

I would like to create an array of checkboxes using the above data. Actually, an array of arrays, where each item has an array of the checkbox id and the action. Something like this:

local $cb = [[GUICtrlCreateCheckbox(…),'doit1'],[GUICtrlCreateCheckbox(…),'doit2],…]

only generated dynamically.

From here on, I am lost because the error messages I get are not very informative.

To begin with, I have:

local $checkboxes[$values[0][0]]
for $i = 1 to $values[0][0]
    local $cb = [GUICtrlCreateCheckbox($values[$i][0], 20, 80+$i*20),$values[$i][1]]
    ;   how do I add to the array?
next

;   event loop …

;   process checked items
for $i=0 to ubound($checkboxes)-1
    MsgBox($MB_SYSTEMMODAL, "CB", $checkboxes[$i][0])   ;   checkbox resource
    MsgBox($MB_SYSTEMMODAL, "CB", $checkboxes[$i][1])   ;   checkbox action
next

How can I add the checkboxes to the array so that the processing loop above works?

I thought I could do this:

    local $cb = [GUICtrlCreateCheckbox($values[$i][0], 20, 80+$i*20),$values[$i][1]]
    $checkboxes[$i-1] = $cb
next

which I thought would create a nested array, but when I check $checkboxes[1][0] and $checkboxes[1][1] I see that that isn’t the case.




Checkbox on change event is not working on Safari

Thanks in advance for the help on this. I have a special requirement on my page where I needed a checkbox to "act" like a radio button, so only one can be checked at a time. To achieve that I used this snippet below"

<script>
$('input:checkbox').on('change', function() {
  $('input:checked').not($(this)).closest('.w-checkbox').click();
});
</script>

It works perfectly on Chrome. However, it doesn't work on Safari and allows more than one checkbox to be clicked. I was wondering if anyone had ideas on how to solve this because I have tried many alternatives and unfortunately need to have the checkbox




vendredi 8 juillet 2022

Automated test passes but checkbox is not checked(selected)

I have the following element:

'''<input id="InventoryTrackingAllowOutOfStockPurchases" name="allowOutOfStockPurchases" type="checkbox" class="Polaris-Checkbox__Input_30ock" aria-invalid="false" role="checkbox" aria-checked="false" value="">'''

I use the following code in order to check if the checkbox is checked:

 WebElement sellWithoutStock = driver.findElement(By.name("allowOutOfStockPurchases"));
            sellWithoutStock.isSelected();

The thing is that I run the test when the checkbox is unchecked but still the test passes. By running the test I just want to confirm whether the checkbox is checked or not. Any ideas about what I'm doing wrong here? Thanks




Flutter - how to implement checkboxes with Bloc

I am trying to create a list with checkboxes with a Select All option at the top. The current code works fine with the SelectAll/De-selectAll.

The problem is, even the individual checkboxes are working as a SelectAll checkbox. Meaning, any checkbox when selected/de-selected, selects/de-selects all other checkboxes.

HomePage:

    import 'dart:convert';
    import 'dart:io';
    import 'package:flutter_bloc/flutter_bloc.dart';
    import 'package:http/http.dart' as http;
    import 'package:boost/resources/toast_display.dart';
    import 'package:flutter/material.dart';
    import 'package:internet_connection_checker/internet_connection_checker.dart';
    import '../models/meetings.dart';
    import '../models/test.dart';
    import '../resources/app_strings.dart';
    import '../utils/accesss_token_manager.dart';
    import '../utils/app_urls.dart';
    import '../utils/constants.dart';
    import '../utils/routes.dart';
    import '../widgets/cubit/notification_cubit.dart';

    class NewHomeScreen extends StatefulWidget {
      const NewHomeScreen({Key? key}) : super(key: key);

      @override
      State<NewHomeScreen> createState() => _NewHomeScreenState();
    }

    class _NewHomeScreenState extends State<NewHomeScreen> {
      Meeting meeting = Meeting();
      List<WeeklyMeeting> weeklyMeetingsList = [];
      bool isSelectAll = false;
      bool isMeetingSelected = false;
      final allowNotifications = NotificationSetting(title: 'Allow Notifications');

      final notifications = [
        NotificationSetting(title: 'Show Message'),
        NotificationSetting(title: 'Show Group'),
        NotificationSetting(title: 'Show Calling'),
      ];

      @override
      Widget build(BuildContext context) => Scaffold(
            appBar: AppBar(
              title: const Text('Test'),
            ),
            body: ListView(
              children: [
                buildToggleCheckbox(allowNotifications),
                const Divider(),
                ...notifications.map(buildSingleCheckbox).toList(),
              ],
            ),
          );

      Widget buildToggleCheckbox(NotificationSetting notification) => buildCheckbox(
          notification: notification,
          onClicked: () {
            BlocProvider.of<NotificationSelectionCubit>(context)
                .toggleAllowNotificationSelection();
          });


      Widget buildSingleCheckbox(NotificationSetting notification) => buildCheckbox(
            notification: notification,
            onClicked: () {
              BlocProvider.of<NotificationSelectionCubit>(context)
                  .toggleIndividualNotificationSelection();
            },
          );

      Widget buildCheckbox({
        required NotificationSetting notification,
        required VoidCallback onClicked,
      }) {
        return BlocBuilder<NotificationSelectionCubit, NotificationState>(
          builder: (context, state) {
            return ListTile(
              onTap: onClicked,

 /// stack is used only to give the checkboxes a radio button look, when a checkbox
     is selected it will look like a checked radio button, and when de-selected, it will
     look like an unselected radio button.

              leading: Stack(children: [
                Visibility(
                  visible: state.value,
                  child: Checkbox(
                      shape: const CircleBorder(),
                      value: !state.value,
                      onChanged: (val) {
                        onClicked();
                      }),
                ),
                Visibility(
                  visible: !state.value,
                  child: IconButton(
                    onPressed: () {
                      onClicked();
                    },
                    icon: const Icon(Icons.radio_button_checked),
                  ),
                )
              ]),
              title: Text(
                notification.title,
                style: const TextStyle(fontSize: 20, fontWeight: FontWeight.bold),
              ),
            );
          },
        );
      }
    }

NotificationSelectionCubit class

        class NotificationSelectionCubit extends Cubit<NotificationState> {
      NotificationSelectionCubit()
          : super(NotificationState(value: false, allowNotification: false));
      final allowNotifications = NotificationSetting(title: 'Allow Notifications');

      final notifications = [
        NotificationSetting(title: 'Show Message'),
        NotificationSetting(title: 'Show Group'),
        NotificationSetting(title: 'Show Calling'),
      ];

      void toggleIndividualNotificationSelection() {
        for (var notification in notifications) {
          return emit(NotificationState(
              value: !state.value, allowNotification: state.allowNotification));
        }
      }

      void toggleAllowNotificationSelection() => emit(NotificationState(
          value: state.allowNotification,
          allowNotification: !state.allowNotification));
    }

And

    class NotificationState {
      bool value;
      bool allowNotification;
      NotificationState({required this.value, required this.allowNotification});
    }



jeudi 7 juillet 2022

django admin select all checkbox not present

Please read this question! The "select all" header checkbox that I used in Django 1.5 is missing in Django 1.9

I have same problem with django version 3.2.14. I am new to django and not understanding what is overriding in my files that even I can't see this select all checkbox. Also, I did run "python ./manage.py collectstatic" this. it still didn't change anything on my portal.

Thanks in advance!




Hide columns based on checkbox value

I would like to implement a code to my production plan. Is there a way to hide column based on the checkbox true value? Lets say I added the checkboxes to the row 5, and I want to hide each column starting from M column separately upon ticking the checkbox. I implemented the code to hide the rows, but for columns it's getting tricky since I'm not experienced in google script.

Would it be perhaps also possible to add custom filter to show all hidden columns at once, lets say if I wanna make changes in one of them, and then hide all of them at once?

enter image description here




mercredi 6 juillet 2022

Symfony read only checkbox checked

I'm looking for a way to disable text input validation and readOnly the TextType if the box is checked?

$formBuilder
            ->add('text',      TextType::class,array(
            'required' => true,
            'constraints' => array(
                new NotBlank()
            )))
            ->add('box',      CheckboxType::class, array(
                'mapped' => false,
                'label' => 'Box'
            ))

    ;



lundi 4 juillet 2022

if the is_default column in database is 1 fill the checkbox

i want to fill checkbox using jquery when the is_default column in database is 1 so i get info from backend using getJSON() for check something like if the mobile number id was equal with data-id in input tag fill the check box for example my customers has 2 mobile number and i want just send sms to 1 number of it so i want to show wich mobile number is default using api and laravel and jquery

var tbody = '';
$.each(data, function(key, value) {
    tbody += '<tr>';
    tbody += '<td><div class="form-group"><div class="checkbox checkbox-primary"><input data-id="' + value.id + '" id="checkbox1" type="checkbox"><label for="checkbox1"></label></div></div></td>;'
    tbody += '</tr>';
});
$('tbody').append(tbody);
 
$.getJSON("http://localhost:8000/api/customers/mobile-numbers/checkbox/" + getID() + "", function(data) {
        $.each(data, function(key, value) {
        if (value.id === $('input#checkbox1').data('id')) {
            $('input#checkbox1').prop('checked', true);
        }
    });
});

in the above code fill all checkbox but i want to fill only the default mobile number something like this below code

$.getJSON("http://localhost:8000/api/customers/mobile-numbers/checkbox/" + getID() + "", function(data) {
        $.each(data, function(key, value) {
        if (value.id === $('input#checkbox1').data('id')) {
            $('input#checkbox1').data('id').prop('checked', true);
        }
    });
});

enter image description here

i want something like above code but i get error that can`t reading .prop after .data thanks for your helping




dimanche 3 juillet 2022

Select deselect checkbox on cart page

I want to add checkbox on cart page so user can select and deselect the products on cart page. A checkbox before each product As you can see on the imageImage showing my query best




How to check mat-checkbox based on label during Cypress test?

Is it possible to check a mat-checkbox in a Cypress test based on it's label text?

Below is the HTML for the checkbox:

enter image description here

I have several checkboxes to test, so I want to re-use code to do something like - When I check the 'Advanced search' checkbox, When I check the 'Basic search' checkbox, etc.




Change the default value of CKECKBOX

I'm using VueJS and HTML Bootstrap.

This is my code in HTML:(Prinitint li from a list on products)

const app = new Vue({
  el: "#app",
  data: {
    //Array de articulos que parseamos desde el fichero json
    articulos: [],
    articulosProducir:[],
    //Array del fetch de json de empresas
    empresas: [],

    //Por defecto primero va a tener la primera empresa de la array
    currentEmpresa: {},
    currentENombre:"",
    currentESerie:"",

    //Atributos de los aticulos
    fondos:[],
    laterales:[],
    tapas:[],

  },
  /*Metodos que se ejecutan al iniciar la pagina*/
  created() {
    this.getProducts();
    this.getEmpresas();
  },
  methods: {
    comprobar:function (index) {
      console.log(this.fondos[index])
      console.log(this.laterales[index])
      console.log(this.tapas[index])
      if (this.fondos[index] === true && this.laterales[index] === true && this.tapas[index] === true) {
        return true;
      } else if (this.fondos[index] === false && this.laterales[index] === true && this.tapas[index] === true) {
        return true;
      } else if (this.fondos[index] !== true && this.laterales[index] !== true && this.tapas[index] === true) {
        return true;
      } else if (this.fondos[index] === true && this.laterales[index] === false && this.tapas[index] === false) {
        return true;
      } else if (this.fondos[index] === false && this.laterales[index] === true && this.tapas[index] === false) {
        return true;
      }
    },
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.17/vue.js"></script>
<ul v-if="filter(a)" v-for="a in articulos" :key="`$index`" class="list-group list-group-horizontal col-12">

                    <li class="list-group-item col-3" v-bind:class="{'green-color': comprobar($index)}">
                        
                    </li>
                    <li class="list-group-item col-4" v-bind:class="{'green-color': comprobar($index)}"></li>
                    <li class="list-group-item col-2" v-bind:class="{'green-color': comprobar($index)}"></li>
                    <li class="list-group-item col-1" v-bind:class="{'green-color': comprobar($index)}">
                        <div v-if="a.fondo === 'X'" class="form-check" >
                            <input  class="form-check-input" v-model="fondos[$index]" type="checkbox" value="false" id="check1">
                            <label class="form-check-label" for="check1">
                                
                            </label>
                        </div>
                        <div v-else></div>
                    </li>
                    <li class="list-group-item col-1" v-bind:class="{'green-color': comprobar($index)}">
                        <div v-if="a.lateral === 'X'" class="form-check">
                            <input  class="form-check-input"  v-model="laterales[$index]" type="checkbox" value="false" id="check2">
                            <label class="form-check-label" for="check2">
                                
                            </label>
                        </div>
                        <div v-else></div>
                    </li>
                    <li class="list-group-item col-1" v-bind:class="{'green-color': comprobar($index)}">
                        <div v-if="a.tapa === 'X'" class="form-check">
                            <input class="form-check-input"  v-model="tapas[$index]" type="checkbox" value="false"  id="check3">
                            <label class="form-check-label" for="check3">
                                
                            </label>
                        </div>
                        <div v-else></div>
                    </li>

            </ul>
The idea is to program an inventory with products, and when 3 checkbox of a product are checked, the product can be sended to the factory.

The problem is that thev-model="fondos[$index]" is undefined by deafult and i want to set in False as default!




samedi 2 juillet 2022

Flutter: Checkbox Tristate won't work on Null Safety

how can i archive tristate for checkbox with nullsafety.... i have to pass null into that value but nullsafety has to perform null check on a variable, this is just contradicting .....

putting null check as usual:

                 bool? parentvalue;

                 void update() {
                     parentvalue = null;
                  }


                 Checkbox(
                      ....
                      value: parentvalue!,
                  onChanged: update(),
                      ....
                    ),



ERROR: Null check operator used on a null value

if i remove null check...code cannot compile at all

                  bool parentvalue;

                  void update() {
                    parentvalue = null;
                    }


                  Checkbox(
                      ....
                      value: parentvalue,
                      onChanged: update(),
                      ....
                    ),

ERROR: A value of type 'Null' can't be assigned to a variable of type 'bool'. 



vendredi 1 juillet 2022

How to link a checkbox and a button in a specific record in MS Access

I am about to link a checkbox and a button in the MS Access form. the button becomes disabled when the checkbox is unchecked and becomes enabled whenever it is checked. I have written lines to run this command. but the results are not satisfying. because all the same buttons become enabled when I check a checkbox. and all buttons become disabled when I uncheck a checkbox. (I mean there is no link between the button and the checkbox in a specific record.) My code is:

Private Sub reqChooesed_Click()

 If Me.reqChooesed = True Then
        Me.Command1.Enabled = True
    Else
        Me.Command1.Enabled = False
    End If
End Sub

[Example 1][1] [Example 2][2] [1]: https://ift.tt/vdSTMu7 [2]: https://ift.tt/n6baxSA




Flutter : checkbox add array data to hit POST API, and error checkbox

I have problem with checkbox to add parameter hit to POST data for API.

This is POST data sent when I clicked Save Button :

Map<String, String> params = {
        'pet_name': petNameCtrl.text,
        'pet_healths[0]': '3', //manual
        'pet_healths[1]': '4', //manual
    };
    
    final response = await http.post(
      Uri.parse(
        "http://localhost:8000/api/v1/pet",
      ),
      headers: {'Authorization': 'Bearer $token'},
      body: params,
    );
}

This is how my checkbox data called from API and the widget :

List<PetHealthModel> petHealths = [];
bool selectedPetHealth = false;


  void fetchPetData() {
    getDataHealth();
  }

  void getDataHealth() async {
    final response = await http.get(
      Uri.parse("http://localhost:8000/api/v1/pet_health"),
    );
    final metadata = PetHealthsMetadata.fromJson(jsonDecode(response.body));
    setState(() => petHealths = metadata.data);
  }
  
  
petHealths.isNotEmpty
    ? Padding(
    padding: const EdgeInsets.all(8.0),
    child: Column(
        children: petHealths.map((e) {
            return CheckboxListTile(
                title: Text(e.healthStatus),
                value: selectedPetHealth,
                onChanged: (bool? value) {
                    setState(() {
                        selectedPetHealth = value!;
                    });
                }
            );
        }).toList(),
    ),
)

*btw I have secondary problem that if I select one of the checkbox, all checkbox will selected too. here's the picture

enter image description here

Please help, get stuck here for many days.

here's the sample for API :

enter image description here

PetHealthModel :

class PetHealthModel {
  PetHealthModel({
    required this.id,
    required this.healthStatus,
  });

  final int id;
  final String healthStatus;

  factory PetHealthModel.fromJson(Map<String, dynamic> json) => PetHealthModel(
        id: json["id"],
        healthStatus: json["health_status"],
      );

  Map<String, dynamic> toJson() => {
        "id": id,
        "health_status": healthStatus,
      };
}


class PetHealthsMetadata {
  PetHealthsMetadata({
    required this.data,
    required this.code,
    required this.msg,
  });

  final List<PetHealthModel> data;
  final int code;
  final String msg;

  factory PetHealthsMetadata.fromJson(Map<String, dynamic> json) =>
      PetHealthsMetadata(
        data: List<PetHealthModel>.from(
            json["data"].map((x) => PetHealthModel.fromJson(x))),
        code: json["code"],
        msg: json["msg"],
      );

  Map<String, dynamic> toJson() => {
        "data": List<dynamic>.from(data.map((x) => x.toJson())),
        "code": code,
        "msg": msg,
      };
}

*updated

Here is what it printed everytime the checkbox changed :

enter image description here

For final problem is how to made it auto add to Map<String, String> params ? see params code above