jeudi 19 janvier 2017

Bookmarklet to Select Multiple Specific Checkboxes Based on Input

I've been trying to find a way to select multiple checkboxes based on a list of IDs.

The checkboxes are in a list on the website with multiple columns, what I'm trying to do is use the serial numbers in column CCC to specify which checkboxes I want. I have a spreadsheet of a few hundred, to a few thousand, serial numbers I need to check.

The code for the checkboxes on the website looks like this (it's not my website, but I have to run reports from it using these checkboxes):

<tr data-rowid="999999_1234" class="dataRow 
        ">
        <th data-responsetype="GridRow" class="hidden" style="min-width: 19px;"></th>
          <td data-columnname="SELECT" data-celltype="Action" data-name="ActionName">

                <input type="checkbox" class="rowSelector">
          </td>
          <td data-columnname="AAA" data-celltype="Normal">
                    ABC
          </td>
          <td data-columnname="BBB" data-celltype="Normal">
                    ABC2
          </td>
          <td data-columnname="CCC" data-celltype="Normal">
                    999
          </td>
          <td data-columnname="DDD" data-celltype="Normal">
                    ABC3
          </td>
          <td data-columnname="EEE" data-celltype="Normal">
                    ABC4
          </td>
          <td data-columnname="FFF" data-celltype="Normal">
                    ABC5
          </td>
          <td data-columnname="GGG" data-celltype="Normal">
                    ABC6
          </td>
          <td data-columnname="HHH" data-celltype="Normal">
                    ABC7
          </td>
          <td data-columnname="III" data-celltype="Normal">
                    888
          </td>
</tr>

I've looked around for bookmarklets that check boxes, but everything seems to be based on checking or unchecking everything. The specific ones I've found seem to reference an ID for the checkbox itself, but based on the code from the website it looks like the checkbox belongs to an object(node?). So I'm not sure what I would do to select them from script. I figured once I get that part down, I could work my way back from there to finding the specific data-rowids containing the CCC value I want, and then selecting those checkboxes.

I realize this is a multi-layered question, so even just some direction on selecting the checkboxes using the data-rowid would be helpful.

Thanks everyone, let me know if I'm missing any pertinent information for figuring this out.

Aucun commentaire:

Enregistrer un commentaire