jquery - Validating file name for creating file in windows, using regular expression in javascript -
i need read file name text box given user creating file in windows. need restrict special characters entered in text box \ / : * ? " < > |
how can validate in javascript function using regular expression? tried below code.
var rg1 = new regexp('/^[^\\/:\*\?"<>\|]+$/'); if (rg1.test($("qcattachmentname").value)) { showerrordetails("enter valid attachment name", 0); return ""; }
but not working.
your script , regex pattern have errors. please find fiddle here working sample
Comments
Post a Comment