learning bootstrap 4 and trying to call the modal popup when the input on change event but not sure whether that will be a correct solution or not.
Once I delete the existing text from the input, that should trigger the modal automatically after the last text deletion. Currently, this is getting triggered once I click out of the input box.
if ($("input[id$='CheckboxPhone']").is(":checked")) {
$('.testing').on('change', function() {
if ($(this).val().length < 1) {
//call bootstrap modal, for testing we will call alert
alert("test");
}
});
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<html>
<body>
<input type="text" id="testing" class="testing" value="2144566189" data-value="214-456-6189">
<form class="form-test">
<div class="checkbox m-l-20 m-t-sm-10">
<input type="checkbox" id="customerServiceCheckboxPhone" name="customerServiceCheckboxPhone" checked="checked" class="js-test valid">
<label class="checkbox-check" tabindex="0" for="customerServiceCheckboxPhone"></label>
</div>
<div class="checkbox m-l-20 m-t-sm-10">
<input type="checkbox" id="offersCheckboxPhone" name="customerServiceCheckboxPhone" checked="checked" class="js-test valid">
<label class="checkbox-check" tabindex="0" for="offersCheckboxPhone"></label>
</div>
<div class="checkbox m-l-20 m-t-sm-10">
<input type="checkbox" id="testCheckboxPhone" name="customerServiceCheckboxPhone" checked="checked" class="js-test valid">
<label class="checkbox-check" tabindex="0" for="testCheckboxPhone"></label>
</div>
</form>
</body>
</html>