Submit don't bubble but could be simulated. I have been working on
simulating the bubbling for submit/reset/change/focus/blur, but I
don't have any free time those days:

  function isEventSupported(eventName){
    var element = document.createElement("div"), result;

    eventName = "on" + eventName;
    if (eventName in element){
      return true;

    element.setAttribute(eventName, "return;");
    result = Object.isFunction(element[eventName]);
    element = null;

    return result;

  if (!isEventSupported('submit')){
    function isForm(element) {
      return Object.isElement(element) &&
element.nodeName.toUpperCase() == 'FORM';

    function skipOneSubmit(e){
      Event.stopObserving(this, 'submit', skipOneSubmit);

    function emulateSubmit(e, element){
      if (element.form &&'emulated:submit').stopped){
        Event.observe(element.form, 'submit', skipOneSubmit);

    document.on('mousedown', 'input[type=submit],input[type=image]',
function(e, element){
      if (e.keyCode == Event.KEY_RETURN){
        emulateSubmit(e, element);

    Event.Handler.prototype.initialize =
Event.Handler.prototype.initialize.wrap(function(initialize, element,
eventName, selector, callback) {
      if (eventName == 'submit' && !isForm(element)){
        eventName = 'emulated:' + eventName;

      initialize(element, eventName, selector, callback);

This is just cut - paste from a bigger script, so it could contain
errors. I still haven't tested.
Hope this will could be some help, if try using it please send me some
feedback :)

You received this message because you are subscribed to the Google Groups 
"Prototype &" group.
To post to this group, send email to
To unsubscribe from this group, send email to
For more options, visit this group at

Reply via email to