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

Re: My AsyncRequest Failling In Opera !!

Expand Messages
  • chaluwa
    This is the flow of my login module: // this is within my namespace, and am using the module pattern // handles have been defined at point var isEnterKey =
    Message 1 of 3 , Mar 1, 2008
    • 0 Attachment
      This is the flow of my login module:

      // this is within my namespace, and am using the module pattern
      // handles have been defined at point
      var isEnterKey = function(e){
      // inspect event and return true only if the enter key was pressed
      }

      var handleLogin = function(form){
      // as defined in my early post.
      // makes an asyncronous request to the server
      // with input of the passed form
      // if all went well, redirect the user
      }

      var doLogin = function(e){
      if( isEnterKey(e) ){
      var form = evt.getTarget(e).form;
      // YHUB is my hub of utilities for yui, YHUB.util.Forms
      // manages form related issues.
      // this is where handleLogin gets called, but only if
      // required fields have been filled with data and validated
      // handleLogin gets called with the value of the frm property
      // of the config object passed as the parameter to this call.
      // it is actually the form we declared just above.
      YHUB.util.Forms.checkFields(e,{frm:form, handler: handleLogin});
      }
      };

      // then we attach events to the input fields
      // evt is a handle for YAHOO.util.Event
      evt.addListener(dom.get('usr'), 'keydown', doLogin);
      evt.addListener(dom.get('pswd'), 'keydown',doLogin);

      // end of code block
      The form in the markup has no submit button (for firing submit
      events), just two input fields which I attach event listeners to, and
      send their entries to the server after some checking.
      I'll however try the stopEvent suggestion you made.

      Thanks.
    Your message has been successfully submitted and would be delivered to recipients shortly.