Submit form with no action atribute pressing enter key?

Just capture the submit function as if the form had been submitted via the enter button normally.

Just capture the submit function as if the form had been submitted via the enter button normally. Document.searchForm. Submit = function() { //do something return false; // prevents default action }.

(that function retrieves all the input values and sends the $. Ajax via post – Toni Michel Caubet Aug 8 at 21:20 @Toni Typically when any element of a form is currently focussed and a user hits Enter, the form is submitted. Whatever way the form is submitted, this code will capture that event, allow you to do something like your ajax call, and prevent the default action which should be to submit the form to the URL contained in the action attribute (which defaults to the current page if empty or not there).

– Endophage Aug 8 at 22:48 @Toni note the solution from Grigor is equally valid, it is just a jQuery version as opposed to a pure js version. There are many cases where the jQuery version provides more robustness but as far as I know, the submit event is universal across browsers so my version is mildly lighter weight. – Endophage Aug 8 at 22:51 Thanks!

The problem is that in the form there is not submit input (its not my code :() – Toni Michel Caubet Aug 8 at 5:59.

$('#searchForm'). Submit(function(e) { e.preventDefault(); return false; }) try that, I am sure it'll work. It uses jQuery plulgin, so make sure you have it included.

I need to send the form via post, thanks! – Toni Michel Caubet Aug 8 at 15:52 edited the question, what if instead of your e.preventDefault() I write myFormProcessFunction()? – Toni Michel Caubet Aug 8 at 16:40.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions