FRIHOSTFORUMSFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a Frihost Account!

Submit Form Enter

 


fromegame
Crying or Very sad

I tryed everything.
How can I submit a form just using the enter button and not click on the Submit button. I have 3 forms. In 1 form it works, and in the other 2 it doesn't....

Please help me:

http://frihost.pastebin.com/847751

Crying or Very sad
nioton
fromegame wrote:
Crying or Very sad

I tryed everything.
How can I submit a form just using the enter button and not click on the Submit button. I have 3 forms. In 1 form it works, and in the other 2 it doesn't....

Please help me:

http://frihost.pastebin.com/847751

Crying or Very sad


Cool
If you try to use the form like this :

Code:

<form method="post" action="#">
   <p><input type="text" name="email" size="20"></p>
</form>


It will be worked by pressing the Enter. it will be worked on IE, Netscape, Firefox.

then you can check the data of the form.

Question
fromegame
It won't, I need to click submit here also...
sonam
Maybe this link can help you:

http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/reference/events/onkeypress.asp

Sonam
fromegame
But it DOES work with my other form:

http://frihost.pastebin.com/847918
hexkid
fromegame wrote:
http://frihost.pastebin.com/847751

I believe it's invalid to have a form inside a <tr> element. Maybe that's the reason pressing ENTER will not submit your form.

Validate your HTML (here).
You also might consider asking this question in the HTML, CSS and JavaScript forum.
nioton
look, Exclamation
I have tested it with those explorers and when you press enter the action of the form will be called.

but maybe something strange is in your code.
if you want you can send me the file then I will look for the problem.

Wink

.
fromegame
hexkid wrote:
fromegame wrote:
http://frihost.pastebin.com/847751

I believe it's invalid to have a form inside a <tr> element. Maybe that's the reason pressing ENTER will not submit your form.

Validate your HTML (here).
You also might consider asking this question in the HTML, CSS and JavaScript forum.


But in that other form (that does work) is also a table?
hexkid
fromegame wrote:
But in that other form (that does work) is also a table?
That is why asking about HTML in the PHP forum is wrong.
It's like going to your auto mechanic and ask about the plumbing problem you have Smile
fromegame
No, because it has something to deal with the php I think Shocked

Because the forms are almost exactly the same! Confused
vignesh_natraj
you can change the type to hidden and then try it
mathiaus
fromegame wrote:
it has something to deal with the php I think

I guess you don't know what PHP is then?

-moved-

Both work for me, both in Firefox (2.0.0.1) & IE 7. Maybe providing a link to the whole actual page where these are located will return something?
fromegame
http://www.frome.frih.net/?p=login = is working
http://www.frome.frih.net/index2.php?p=internet = is not working (need to registrate to see this one)
Reply to topic    Frihost Forum Index -> Scripting -> Html, CSS and Javascript

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2007 Frihost, forums powered by phpBB.