Only One Checkbox Selected

Size
1,957 Kb
Views
74,888

How do I make an only one checkbox selected?

What is a only one checkbox selected? How do you make a only one checkbox selected? This script and codes were developed by Emerson Thompson on 11 August 2022, Thursday.

Only One Checkbox Selected Previews

Only One Checkbox Selected - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Only One Checkbox Selected</title>
</head>
<body> <html ng-app="ionicApp"> <head> <meta charset="utf-8"> <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width"> <title>One Checkbox Selected</title> <link href="//code.ionicframework.com/nightly/css/ionic.css" rel="stylesheet"> <script src="//code.ionicframework.com/nightly/js/ionic.bundle.js"></script> </head> <body ng-controller="MainCtrl"> <ion-header-bar class="bar-positive"> <h1 class="title">One Checkbox Selected</h1> </ion-header-bar> <ion-content> <ion-list> <ion-item class="item-checkbox" ng-repeat="item in itens"> <label class="checkbox"> <input type="checkbox" ng-model="item.checked" ng-click="updateSelection($index, itens, item.title)"> </label> {{ item.title }} </ion-item> </ion-list> </ion-content> <ion-footer-bar ng-class="(selected)? 'bar-balanced' : 'bar-positive'"> <h1 class="title">{{ selected }}</h1> </ion-footer-bar> </body>
</html> <script src="js/index.js"></script>
</body>
</html>

Only One Checkbox Selected - Script Codes JS Codes

angular.module('ionicApp', ['ionic'])
.controller('MainCtrl', function($scope) { $scope.itens = [ { title: "Item 1", checked: false }, { title: "Item 2", checked: false }, { title: "Item 3", checked: false }, ]; $scope.updateSelection = function(position, itens, title) { angular.forEach(itens, function(subscription, index) { if (position != index) subscription.checked = false; $scope.selected = title; } ); }
});
Only One Checkbox Selected - Script Codes
Only One Checkbox Selected - Script Codes
Home Page Home
Developer Emerson Thompson
Username thompsonemerson
Uploaded August 11, 2022
Rating 3
Size 1,957 Kb
Views 74,888
Do you need developer help for Only One Checkbox Selected?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Emerson Thompson (thompsonemerson) Script Codes
Create amazing web content with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!