I have a textarea field in a form where I can copy paste mobile numbers. It will have one number per line, like this I can copy paste thousands of mobile numbers to submit in that form.
I want to trim that field, I only want 10 digit numbers to remain in that field after copy paste a lot of numbers from excel or any other file.
Only 10 digit numbers should remain and all other invalid numbers should automatically remove from that field.
Example:
IF I paste this numbers in this textarea field,
9848012345
9949123450
9949 123456
99491234
+1236547890
9848098765
From this only 10 digit numbers should remain in field, like this:
9848012345
9949123450
9848098765
<div class="form-group row">
<label for="title" class="col-lg-2 col-form-label">Mobile Numbers </label>
<div class="col-lg-10">
<textarea onKeyUp="countline()" type="text" class="form-control required" required
cols="10" rows="7" id="mobileno" name="mobileno"> </textarea>
</div>
</div>
This is possible with Java script? Any help please. Thanks in advance.