While adding text in a textarea, I dont want to allow ‘*’ after ‘&’.
I want to check on Asterisk keypress, whether previous symbol added is ‘&’, if yes, user cannot add ‘*’.
Kindly help, how to proceed.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You might be better off having a general function that runs after every “keyup” event which cleans up the textarea by removing any asterisks (
*) immediately after an ampersand (&). This way, even if the user pastes some content which contains the invalid sequence (&*) it will still be cleaned up. So something like this: