How To Stop Page Refresh On Typing In Form Input?
I'm breaking my head over a small issue. I have a chat box in my web app which contains one input[type='text'] and a button. What I want is whenever user clicks on the button, the
Solution 1:
In order to avoid the submition of the form, you have to add an event.preventDefault() to your submitNewMessage function.
Other way is to remove the form tags.
Post a Comment for "How To Stop Page Refresh On Typing In Form Input?"