Firefox PHP

how to give focus to the subject on reply?

Posted by farang 
how to give focus to the subject on reply?
November 02, 2009 09:13PM
when posting a new topic, the subject line is given focus automatically (ie the cursor is placed into the subject text box)

however, the subject line is not given focus when replying to a post

how can I give focus to the subject on replies?

ITA
Re: how to give focus to the subject on reply?
November 02, 2009 10:15PM
Doing the focusing on pageload is quite easy. Doing the focusing when the user clicks reply is less easy. You would have to modify the behavior of the reply link, to call some javascript instead of just following the reply URL link. The javascript must load the URL for the reply link to get to the correct reply editor. That same bit of javascript would also be responsible for doing the focusing, but beware that sometimes, the page will reload to get to the correct reply editor. Therefore, you cannot assume that simply following the URL and doing a focus would be enough. Another thing to beware of, is that the reply link should not be rendered useless in case the browser does not have javascript enabled.

What might be an option, is to check out the hide reply editor module that I wrote. That one already does a whole bunch of javascript handling. Maybe that one provides a good hook to hack in the field focusing.

I hope this provides you some handles to work with. All in all, it's not as trivial a task as one might think.

Unless...

you configure Phorum to always show the editor on a separate page. In that case the focusing will be handled by the page load code. This might however not be how you want your users to experience your forum.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Sorry, only registered users may post in this forum.

Click here to login