Amith Amith - 1 year ago 105
Javascript Question

regular expression in javascript which allows backspace

My regular expression which allows characters, numbers, dot and underscore is

var numericReg = /^[a-zA-Z0-9\._]+$/;

How could i allow backspace in this reg ex.?

Answer Source

The optimal solution for this problem is to check the value of textbox >0 before validating. This will help to solve error showing while pressing backspace in an empty textbox..!!

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download