skip to Main Content

Remove last dots from characters in jquery

How to remove only the last dots in characters in jquery? Example: 1.. 1.2. Expected result: 1 1.2 My code: var maskedNumber = $(this).find('input.CategoryData'); var maskedNumberValue = $(maskedNumber).val().replace(/[^0-9.]/g, '').replace('.', 'x').replace('x', '.').replace(/[^d.-]/g, ''); console.log(maskedNumberValue.slice(0, -1)) How do I solve this problem?…

VIEW QUESTION

How to use AJAX for different functions when more buttons included in the form – Jquery

I have a model as below in PHP. <div id="Modal" class="modal fade"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal">&times;</button> <h4 class="modal-title" >Block</h4> </div> <div class="modal-body"> <form method="post" id="block_form"> <label>Number</label> <input type="text" name="num_block" id="num_block" class="form-control" readonly/> <br />…

VIEW QUESTION
Back To Top
Search