views:

55

answers:

2

I have a form for login.when i put the username and password then press enter it gives the search result.The search text box is in the same page.I want to make the focus to submit button.The enter key issue only appear in IE?what can I do to solve the problem...Thanks in advance...

A: 

You can focus anything with the focus() javascript method. This has nothing to do with PHP.

document.getElementById('ID_Name_Of_Your_Button').focus();
Ólafur Waage
It is an answer to this question, but it is not a solution of the described problem :)
silent
A: 

Submit button must be defined in the same form tag as the other form elements. And submit will be fired on what form you are focused while pressing [enter].

You don't need to focus any submit buttons in your case.

And the document content is needed for the more exact answer of course.

silent