1

I have this form:

 <form id="post-status-form" onsubmit="return test(this,event);" method="post">
        <textarea id="composer-textarea" class="grow" name="composer-textarea"></textarea>
        <input type="hidden" value="1" name="targetid" id="targetid" />
        </form>

with this js:

    $('composer-textarea').addEvent('keydown', function(e) {


    if(e.key == 'enter') {
        e.stop();
        $('post-status-form').submit();
    }
});

when I press enter i need to execute test() js.. How can I do?

Ste
  • 1,497
  • 8
  • 33
  • 63

1 Answers1

0

I tested your code with jsfiddle:

http://jsfiddle.net/PafLu/2/

and it works fine with firefox 3.6.15 and chrome 10.0.648.205.

¿Perhaps you're testing it with IE?

Nicolás Ozimica
  • 9,481
  • 5
  • 38
  • 51