how to give focus to the subject on reply?
Posted by farang
how to give focus to the subject on reply? November 02, 2009 03:13PM |
Registered: 16 years ago Posts: 54 |
November 02, 2009 04:15PM |
Admin Registered: 19 years ago Posts: 8,532 |
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
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



Sorry, only registered users may post in this forum.