0

I have 4 forms.

However, Only one of the forms submits when you press the enter key.

The most obvious difference on this one form, is that it has only one input field.

What causes a form to submit when you press enter?

I tried pressing enter on all fields of the other 3 but it did not have an effect.

Not sure what code to post.

Single Entry

  <form id="fo_at" >      
      <div id = 'at_gl_co'>
        <div id='at_in_wr'>
          <input id="at_go" name="tweet" type="text" maxlength="320" >
          <p id="at_lab" >Post a URL or Comment</p>
          <p id="at_but" >POST</p>
          <p id="at_rc" >POST</p>
        </div>
      </div>
    </form>

    <div id='at_rb'>      
      <div class="i_box_r1" ></div>
      <div class="i_box_r2">
        <p id="at_rt" >Default</p>
      </div>
    </div>

  </div>

1 Answers1

0

Separated my concerns in to two eventListeners like this. One for the special case.

enter: function( event ) {
    if( event.keyCode === 13 ) {
        Co.Controller( Mo.o_p( 'AppTweet' ) ); 
    }
},
enter_one: function( event ) {      
    if( event.keyCode === 13 ) {
        event.preventDefault();
    }
},