<pre lang="HTML"> <input type="text" class="form-control" name="component_gst_percent" id="component_gst_percent{{@$capexItem->po_item_config_id}}" value="{{@$capexItem->component_gst_percent}}" placeholder="Enter GST" onkeydown="javascript: return event.keyCode == 69 ? false : true" oninput="this.value = this.value.replace(/[^0-9.]/g, '').replace(/(\..*?)\..*/g, '$1').replace(/(\.\d{2}).+/g, '$1');">
function checkInput(data){ let gst_input=data.value; let regex=new RegExp("^\\d{0,2}$|(?=^.{0,5}$)^\\d+\\.\\d{0,2}$"); if (!regex.test(gst_input)) { console.log('fail'); return false; } return true; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)