Question and answer is powered by AnsPress.io
I am set a form validation, when user enter some text in input box then it will display a alert message while the enter text’s last character is underscore (“_”). The user can’t submit data with ending underscore of a text.
How can I do it?
Here the example of Last character validation without some special charecter in jquery. Follow this code:
<script type="text/javascript"> if(!/[^_]$/.test(pen_name)){ swal("Please enter a valid Pen Name.", { icon: "error", title: "Enter Letters or Numbers after '_' sign " }); } </script>