A user can type In a separated list In an input field like this for example:
123, 123, 123
123!123!123
123:123:123
When the use Is finished, I want to replace all non-numeric characters with a comma-sign. How can I do that? When the user Is finished, I want the string to be separated with comma signs
I have tried like this:
var accidentFieldVal = $('#accidentId').val().split(/[ ,]+/).join(',');
accidentFieldVal = accidentFieldVal.replace(/,\s*$/, "");