Sorry but I'm quite a noob if it comes to Javascript with HTML. I'm trying to make a button that will change the value of it when a multiple checkboxes are checked.
Example: If one checkbox is checked = Button: Delete 1 row If two checkboxes are checked = Button: Delete 2 rows etc.
And I want this to happen automaticly when I check all checkboxes. The only problem is that I don't know how to call the value of it in a button.
JS:
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script>
$('input[type="checkbox"]').click( function() {
$("input[type=submit]").val("Delete "+$('input:checkbox:checked').length+" rows");
});
</script>
HTML:
<input type="submit" name="submit" class="btn btn-success" value="Verwijder" />
The server-side of this(PHP) does work(deleting the rows). Thank you for helping and your time!