1

Topic: Hot keys and IPB

How to make, that at a forum post sending went and on ctrl+enter?
I found the code:

onKeyPress ='if (event.keyCode == 10 || (event.ctrlKey && event.keyCode == 13)) this. REPLIER.Post.click ()'

REPLIER - a form name
Post - a name textarea
I take the required code and I interpose and textarea after name = "Post". It turned out here is how:

<textarea cols = "80" rows = "15" wrap = "soft" name = "Post" onKeyPress ='if (event.keyCode == 10 || (event.ctrlKey && event.keyCode == 13)) this. REPLIER.Post.click () ' tabindex = "3" class = "textinput" onClick = "storeCaret (this);" onKeyup = "storeCaret (this);" onChange = "storeCaret (this);" onFocus = "storeCaret (this);"> </textarea>

But all the same the post does not send. In what an error?

2

Re: Hot keys and IPB

In that that it is not necessary to copy pieces of the code from other pages, without being cut that happens ;-)
You defined buttons, it is necessary to replace this. REPLIER.Post.click () as you textarea hardly contains form REPLIER, and the form the button with name Post ;-)
We strain brains, we recall as to get the form (document.getElementById), and to send it (form.submit ()), truth it is not forgotten to cause before sending form.onsubmit that would fulfill .

3

Re: Hot keys and IPB

Sardar, 1/9/2006, 14:27, post610123 wrote:

In that that it is not necessary to copy pieces of the code from other pages, without being cut that happens
You defined buttons, it is necessary to replace this. REPLIER.Post.click () as you textarea hardly contains form REPLIER, and the form the button with name Post

So I did not copy the code. this. REPLIER.Post.click () should be such, I substituted smile

4

Re: Hot keys and IPB

1) Throw out  snow from the site - it hangs up all.
2) here so write.

onKeyPress ='if (event.keyCode == 10 || (event.ctrlKey && event.keyCode == 13)) document.getElementById ("postingform").submit ()'

5

Re: Hot keys and IPB

Does not work sad
Here the required code:

<textarea onmouseover ='checkselection () ' id ='fastreplyarea ' cols = "70" rows = "8" name = "Post" onKeyPress ='if (event.keyCode == 10 || (event.ctrlKey && event.keyCode == 13)) document.getElementById ("postingform").submit () ' class = "textarea" tabindex = "1"> </textarea>

6

Re: Hot keys and IPB

Interpose and give the reference

7

Re: Hot keys and IPB

HTML-code review on page correctly displayed all. The link in the signature

8

Re: Hot keys and IPB

sergej.z , even if so:

onKeyPress ='if (event.keyCode == 10 || (event.ctrlKey && event.keyCode == 13)) document.getElementById ("fastreplyarea").submit ()'

too it is impossible, but though a blank page does not produce

9

Re: Hot keys and IPB

Here the code, at a forum works for me:

document.onkeydown=function (e) {
if (e) event=e
if ((event.keyCode == 13) && (event.ctrlKey)) {
document. REPLIER.submit.click ();
}}

If it is necessary, at me still a couple of useful  (color  in a subject  from group of the user; different color cubes ()  from groups - for example, at the administrator grow red cubes on kol-vu messages, at moderators green and .; fast tags in a prompt reply; etc.)

10

Re: Hot keys and IPB

Show the full code textarea

11

Re: Hot keys and IPB

The full code  it that?
It is a tag <textarea>? So it should not be changed at this function.
Or you do not know where to interpose it? Here:
-/-HTML Templates-adjustments HTML-Topic View Section-quick_reply_box_open:
In most began after:
<script type = "text/javascript">
<! -
We interpose that code

12

Re: Hot keys and IPB

All. The question is solved smile
Innuendo +
I thought, it should be interposed in textarea:hehe

13

Re: Hot keys and IPB

There is nothing

14

Re: Hot keys and IPB

Innuendo , unfortunately at you at a forum not absolutely that is necessary for me, but all the same thanks. The code was useful wink
Simply in textarea it was not necessary to subtilize anything, and simply on onkeydown to expose this function and all smile

15

Re: Hot keys and IPB

On 1.3 it 100 % work.
And to interpose it it is necessary not in ... And in Topic View Section-Post Entry in top where  the code