Recent Story Comments http://www.abdevelopment.ca/blog/fixing-enter-key-ahah-forms/feed en Mousedown handler http://www.abdevelopment.ca/blog/fixing-enter-key-ahah-forms#comment-239 <p>I found that the click event didn't work (it still triggered the non-JS submit), but using the mousedown event worked to solve this problem:<br /> <code>$(&quot;#edit-submit&quot;).trigger(&quot;mousedown&quot;);</code></p> Wed, 23 Dec 2009 06:18:31 +0000 Ben Shell comment 239 at http://www.abdevelopment.ca AHAH Helper http://www.abdevelopment.ca/blog/fixing-enter-key-ahah-forms#comment-8 <p>AHAH Helper also helps you alot in these issues. </p> <p>as seen in following example from <a href="http://drupal.org/project/ahah_helper" title="http://drupal.org/project/ahah_helper">http://drupal.org/project/ahah_helper</a> we have a little snippet from the example code. If I'm right this code makes sure of the Enter Key submit is submitted by the ajax call and not a new page load. Make sure you check that module because it really is a handy tool for AJAX Forms and it works splendidly :-)</p> <p> $form['billing_info']['update_usage'] = array(<br /> '#type' =&gt; 'submit',<br /> '#value' =&gt; t('Update usage'),<br /> // Note that we can simply use the generic submit callback provided by the<br /> // ahah_helper module here!<br /> // All it does, is set $form_state['rebuild'] = TRUE.<br /> '#submit' =&gt; array('ahah_helper_generic_submit'),<br /> // We set the 'no-js' class, which means this submit button will be hidden<br /> // automatically by Drupal if JS is enabled.<br /> '#attributes' =&gt; array('class' =&gt; 'no-js'),<br /> );</p> Tue, 20 Jan 2009 13:58:19 +0000 Nick_vh comment 8 at http://www.abdevelopment.ca