I am creating an application in ionic2, I have a page in which I have 5 checkboxes with the different label and 2 toggles with the different label and at the end of the page ‘Submit’ button is there.
so my question is:
When to click on the Submit button, I want to check the state of each checkbox whether it is 'checked = true/false’
Similarly, for toggles whether it is 'checked = true/false’
i.e. The state of 5 checkboxes and 2 toggles at the same time.
I may do this by using ‘ionChange’, but then I have to write ‘ionChange’ method 5 times and check the status of all the checkboxes. But what I want is. Is there any short way to code, to get the state of all checkboxes at the same time when to click on ‘submit’.
@itlr sory i didnt get you… i am not asking about check the state of individual checkboxes…
My question is…
When i clicked on submit button… the submit() function of submit button have to check the state of all checkbox at the same time…
What i want is…
submit() { // here i want to get state of checkbox 1 i.e. true or false // here i want to get state of checkbox 2 i.e. true or false ... // here i want to get state of checkbox 5 i.e. true or false }