Get all selected checkboxes and their associated attributes using angular
NickName:freedomflyer Ask DateTime:2013-05-11T11:54:48

Get all selected checkboxes and their associated attributes using angular

I need to be bundle selected checkboxes together to POST to my server. In each checkbox's attributes, I'm storing some two important values: "pos" (part of speech), and definition. I need to run through each of these checkboxes, push it to a JSON array, and send it off when the "Add Word" button is pressed.

<input type="checkbox" name="definition-checkbox" pos="noun" definition="Hill, rolling grassland" class="ng-valid ng-dirty">

I've thought of turning the checkboxes into element-restricted directives and somehow doing something there, but I'm not sure how to go about getting all the values here, without doing some loop through them all which seems non-Angular.

Any advice?

Prototype

Copyright Notice:Content Author:「freedomflyer」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/16493575/get-all-selected-checkboxes-and-their-associated-attributes-using-angular

More about “Get all selected checkboxes and their associated attributes using angular” related questions

Get all selected checkboxes and their associated attributes using angular

I need to be bundle selected checkboxes together to POST to my server. In each checkbox's attributes, I'm storing some two important values: "pos" (part of speech), and definition. I need to run th...

Show Detail

Angular Get Selected CheckBoxes

I have a list of dynamically filled checkboxes using angular. &lt;div ng-repeat="X in XList"&gt; &lt;label&gt;{{X.Header}}&lt;/label&gt; &lt;input type="checkbox" name="X&qu

Show Detail

Select all if all checkboxes are selected, angular js

On my page I have angular ui accordion, inside of each panel, I'm rendering list with items and checkboxes, also I have checkbox "select all". For selection method and logic I used this resource. In

Show Detail

Get all selected checkboxes in Java

I have a dialog in Java that presents ~ 15 checkboxes to the user. Is there a way to get the names of all the checked checkboxes at once? Currently, I'm looking one by one if they are selected, whi...

Show Detail

Get all selected checkboxes in Java

I have a dialog in Java that presents ~ 15 checkboxes to the user. Is there a way to get the names of all the checked checkboxes at once? Currently, I'm looking one by one if they are selected, whi...

Show Detail

Get values of selected checkboxes and their associated textareas in Javascript

I have a HTML form. In this form I have 5 checkboxes and each checkbox has an associated textarea. So I want to get the values of only the checked checkboxes and their associated textarea text. I am

Show Detail

Selected checkboxes disabling using angular

Have datatable and checkboxes. If we select checkboxes across all pages(few records in each page), I'm able to get all JSON data of the selected records, could any one suggest me how disable the se...

Show Detail

AngularJs Checkbox that will toggle selected on all other checkboxes

I am using AngularJs (Angular 1) and I need to use a checkbox to Select / Unselect all other checkboxes. Right now I have this: &lt;li ng-repeat="item in ctrl.items"&gt; &lt;input type="checkb...

Show Detail

Get values of all selected Checkboxes using Angular

Apologies if this EXACT question has been asked elsewhere as I've searched over the internet but I've found somewhat similar scenarios and their solutions but not one that I'm in search of. Hoping

Show Detail

Angular Material mat-tree with checkboxes select all

I'm using Tree with checkboxes, and I want to add a button to check all checkboxes, I tried different methods but no good, the best thing i was able to achieve is this: selectAllFiscal() { t...

Show Detail