maqskywalker
asked on
validating textbox with regex
Here is my fiddle
https://jsfiddle.net/r2d22k18/7gc5pwaj/2/
I'm trying to prevent typing of this </ or />
In the above fiddle when i type </ or /> the second character is deleted
Instead of deleting the second character , how do I just put a space in between.
So if I type this </ it will put a space in between and show this < /
So if I type this /> it will put a space in between and show this / >
https://jsfiddle.net/r2d22k18/7gc5pwaj/2/
I'm trying to prevent typing of this </ or />
In the above fiddle when i type </ or /> the second character is deleted
Instead of deleting the second character , how do I just put a space in between.
So if I type this </ it will put a space in between and show this < /
So if I type this /> it will put a space in between and show this / >
ASKER
leakim971,
here is the updated fiddle, i replaced the if statement with what you said
https://jsfiddle.net/r2d22k18/wx0uv6ev/1/
But space is not being inserted. Do I have a mistake?
here is the updated fiddle, i replaced the if statement with what you said
https://jsfiddle.net/r2d22k18/wx0uv6ev/1/
But space is not being inserted. Do I have a mistake?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Nice! Genius! Thanks!
Open in new window
by :Open in new window