Loading ...
Sorry, an error occurred while loading the content.

44666RE: [ydn-javascript] Dialog: Submit vs Upload and Hitting Enter

Expand Messages
  • Satyen Desai
    Feb 3, 2009
    • 0 Attachment
      Hi Hans,

      I don't see the behavior you refer to with the following example, which has a file input field, a text input field, a native HTML submit button and a YUI button labeled "Submit", which invokes Dialog's submit method:


      Hitting enter when the text input field has focus (which will result in a form submission on most browsers, for forms containing only 1 text input field), invokes the Upload callback handler. Clicking the native submit button, or the Dialog's submit button do the same.

      Dialog has code which will listen for anything causing a native form submission (such as hitting enter, or clicking a native HTML submit button) and route the form submission through it's configured postmethod (async XHR submission in the above case).

      If you can post a test page, we can take a look at it.


      From: ydn-javascript@yahoogroups.com [mailto:ydn-javascript@yahoogroups.com] On Behalf Of Hans Zaunere
      Sent: Saturday, January 31, 2009 10:26 AM
      To: ydn-javascript@yahoogroups.com
      Subject: [ydn-javascript] Dialog: Submit vs Upload and Hitting Enter


      It appears that there is different behavior between pressing enter and
      clicking submit for a Dialog based form. It's most notable when there's a
      file input.

      For example, when a user actually clicks Submit, both the success and upload
      callbacks are called. When a user simple hits enter, only the upload
      callback is called.

      Is there a way to change this behavior so that it's more reliable. Or at a
      minimum a way to know if the success callback has fired, so that code in
      both places isn't executed twice.


      Hans Zaunere / Managing Member / New York PHP
      www.nyphp.org / www.nyphp.com
    • Show all 3 messages in this topic