How to properly use <form> and <input>


#1

So, I was trying to use <input /> inside a <form> </form>, and I was finding that when I hit enter (which I wanted to do something else), it was causing the whole program screen to go white. Could anyone give me some help with this?


#2

Please provide code, where do you run this form?


#3

When you hit enter you are submitting the form. It makes the page reload if you do not specify form's action (like POST for example). To avoid page reload, you need to use javascript - run this function on submit:

function(e) {
    e.preventDefault();
}

#4

Then nothing will happen, @poisonbee will need to provide more details about what he is attempting, and where he is attempting this


#5

I fixed it, and then gave up on the whole project alltogether. Thanks for
your help though.

P.S. This is what happens when you reply via e-mail with Avast installed:

https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail
Virus-free.
www.avast.com
https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail
<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>


#6

why would you give up on the whole project? What where you trying to do that didn't work?


#7

I was trying to create, in essence, a console, using HTML, for a project,
that, without something unique like that, would be generic and crappy.