# Call function inside dynamically checkbox

**URL:** <https://forum.ionicframework.com/t/call-function-inside-dynamically-checkbox/124965>\
**Category:** ionic-v3\
**Created:** [March 17, 2018, 10:19am UTC](https://forum.ionicframework.com/t/call-function-inside-dynamically-checkbox/124965 "2018-03-17T10:19:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![RomnEmpire](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/romnempire/32/124028_2.png) [@RomnEmpire](https://forum.ionicframework.com/u/RomnEmpire)\
**Post date:** [March 17, 2018, 10:19am UTC](https://forum.ionicframework.com/t/call-function-inside-dynamically-checkbox/124965/1 "2018-03-17T10:19:07Z")

</div>

How to call function inside dynamically checkbox in ionic3?  
i have to call the function if user is select any single checkbox how to do this?

```
		// Object with options used to create the alert
		var options = {
			title: 'Select subcategory',
			buttons: [
				{
					text: 'Cancel',
					role: 'cancel',
					handler: () => {
						console.log('Cancel clicked');
					}
				},
				{
					text: 'Ok',
					handler: data => {
						this._createUsersCategory();
					}
				}
			]
		};

		options.inputs = [];
		//Here we will generate dynamically check-box
		for(let i=0; i< this.selectedSubcategoryArray.length; i++) {
			let subCategoryName = this.selectedSubcategoryArray[i].subCategoryName;
			options.inputs.push({ 
				value: subCategoryName,
				label: subCategoryName,
				type: 'checkbox'
			});
		}
```

---

<div class="post-metadata">

**Author:** ![mhartington](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/mhartington/32/137757_2.png) [@mhartington](https://forum.ionicframework.com/u/mhartington)\
**Post date:** [July 19, 2021, 9:44pm UTC](https://forum.ionicframework.com/t/call-function-inside-dynamically-checkbox/124965/2 "2021-07-19T21:44:39Z")

</div>

Closed on July 19, 2021, 9:44pm UTC


