How do I check whether a user has 'checked' the checkbox & enable the submit button if checked else disable?

Himanshi Gupta

I have seen the other answers as well, I ain't looking forward to show or hide a submit button, rather want it to be enabled or disabled if the checkbox is checked or not, respectively. I am working with Angularjs 2 & so looking for an answer in the same... Here's the html code:

      <input type="checkbox" id="checkbox2">
      <span>I have carefully read the agreement <br/>& agree to all Terms & Conditions</span>
      </center>
      <button md-raised-button class="md-raised" type="submit" id="but5" [disabled]="![checked]" style="margin-left:34px;">NEXT</button>
Cybey

@GünterZöchbauer's answer is almost correct. This is a solution you could use.

<input type="checkbox" #checkbox (change)="angular = checkbox.checked">
<button type="submit" [disabled]="!checkbox.checked ? true : null">

You could also use something like this:

<input type="checkbox" [(ngModel)]="object.selected" />

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to disable or enable a bootstrap submit button if checked checkbox

From Java

How do I check whether a checkbox is checked in jQuery?

From Dev

Enable/disable submit button when any/no checkbox in form is checked

From Dev

How to enable and disable the button in a checked event of checkbox in jQuery?

From Dev

How do I check if checkbox is checked in PHP?

From Dev

how to disable\enable button on checked check box in datatable AngularJS?

From Dev

Disable Button if checkbox is not checked

From Dev

how to check whether checkbox is checked in datagridview column

From Java

How to check in js that user has checked the checkbox in Google recaptcha?

From Dev

How can I disable a checkbox once it has been checked?

From Dev

How can I disable a button until a checkbox is checked?

From Dev

JQuery: If Checked Enable else Disable

From Dev

JQuery: If Checked Enable else Disable

From Dev

jQuery : disable submit button if field empty or checkbox not checked

From Dev

How to check if checkbox has been checked when hovering over an submit / anchor and display an alert prompting users to do so

From Dev

checkbox checked test with submit button

From Dev

how to enable and disable a dropdown list based on whether a radio button is checked or not through jstl in jsp

From Dev

How do I store if a CheckBox has been checked?

From Dev

How do I check if a checkbox is checked or unchecked? (In QTreeWidget)

From Dev

how to dynamically enable and disable button when checkbox is checked and unchecked in semantic UI

From Dev

how to dynamically enable and disable button when checkbox is checked and unchecked in semantic UI

From Dev

How to check if a checkbox is checked

From Dev

In CSS how do I style checkbox or radio button for pressed state apart from checked and not checked?

From Dev

Check if checkbox has a class and is checked

From Dev

How do I check if a radio button is checked using JavaScript?

From Dev

How to keep the record whether a checkbox has been checked or not?

From Dev

How do I view all work that a specific user has checked in?

From Dev

How to enable checkbox when checked?

From Dev

How can I disable stripe button from the beginning and enable it after checked the agreement?

Related Related

  1. 1

    How to disable or enable a bootstrap submit button if checked checkbox

  2. 2

    How do I check whether a checkbox is checked in jQuery?

  3. 3

    Enable/disable submit button when any/no checkbox in form is checked

  4. 4

    How to enable and disable the button in a checked event of checkbox in jQuery?

  5. 5

    How do I check if checkbox is checked in PHP?

  6. 6

    how to disable\enable button on checked check box in datatable AngularJS?

  7. 7

    Disable Button if checkbox is not checked

  8. 8

    how to check whether checkbox is checked in datagridview column

  9. 9

    How to check in js that user has checked the checkbox in Google recaptcha?

  10. 10

    How can I disable a checkbox once it has been checked?

  11. 11

    How can I disable a button until a checkbox is checked?

  12. 12

    JQuery: If Checked Enable else Disable

  13. 13

    JQuery: If Checked Enable else Disable

  14. 14

    jQuery : disable submit button if field empty or checkbox not checked

  15. 15

    How to check if checkbox has been checked when hovering over an submit / anchor and display an alert prompting users to do so

  16. 16

    checkbox checked test with submit button

  17. 17

    how to enable and disable a dropdown list based on whether a radio button is checked or not through jstl in jsp

  18. 18

    How do I store if a CheckBox has been checked?

  19. 19

    How do I check if a checkbox is checked or unchecked? (In QTreeWidget)

  20. 20

    how to dynamically enable and disable button when checkbox is checked and unchecked in semantic UI

  21. 21

    how to dynamically enable and disable button when checkbox is checked and unchecked in semantic UI

  22. 22

    How to check if a checkbox is checked

  23. 23

    In CSS how do I style checkbox or radio button for pressed state apart from checked and not checked?

  24. 24

    Check if checkbox has a class and is checked

  25. 25

    How do I check if a radio button is checked using JavaScript?

  26. 26

    How to keep the record whether a checkbox has been checked or not?

  27. 27

    How do I view all work that a specific user has checked in?

  28. 28

    How to enable checkbox when checked?

  29. 29

    How can I disable stripe button from the beginning and enable it after checked the agreement?

HotTag

Archive