Skip to content
Advertisement

Enter button gets trigrred while enter new line in input form

im working on a project where a user can describe his location in multiple lines but when i press enter button for new line in input form it gets submitted into database. i feel myself stucked here. help me to get rid of this please

my html code is:

JavaScript

and my php code is :

JavaScript

please help me

Advertisement

Answer

Instead of using “<input type=”text” …>” you can use “<textarea ..>” markup. It can be easily used in forms and shouldn’t submit on enter while in this text area.

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement