[Proto-Scripty] Re: Stopping events using Prototype 1.6.1 in IE9 / how compatible is Prototype 1.7 with 1.6.1?

2011-10-20 Thread Luke
Thanks Andrew. I tried upgrading. So far I don't see any problems, Good 
job! :)

-- 
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/prototype-scriptaculous/-/Rvq6OvyfS50J.
To post to this group, send email to prototype-scriptaculous@googlegroups.com.
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.



[Proto-Scripty] Re: Stopping events using Prototype 1.6.1 in IE9 / how compatible is Prototype 1.7 with 1.6.1?

2011-10-19 Thread Andrew Dupont
IE 9 makes major changes to the event system. We had to rewrite the
event code in 1.7 to support it. You can either (a) upgrade to 1.7;
(b) force your site into compatibility mode [1].

I highly recommend option A. If it's not a seamless upgrade, option B
is there as a last resort.

Cheers,
Andrew


[1] 
http://stackoverflow.com/questions/1014666/force-ie8-into-ie7-compatiblity-mode/1014690#1014690

On Oct 15, 10:10 am, Luke lukas.bomb...@googlemail.com wrote:
 Hi,

 I'm currently trying to make my site compatible with IE9 and there's already
 a major problem. I'm using Prototype 1.6.1 and it seems events won't be
 stopped with Event.stop anymore in IE9. I've read on Stackoverflow [1]
 Prototype 1.7 fixes that problem but I'm not sure if I should update.
 Deadline's coming soon and I don't know how much of a problem updating
 Prototype will be.

 So here's my question: Is there a way to stop events in IE9 with Prototype
 1.6.1

 or

 would you recommend upgrading to Prototype 1.7? Would you say there are some
 things that could be problematic?

 Thank you,
 Lukas

 [1]http://stackoverflow.com/questions/3919250/disable-a-link-in-ie9-prot...

-- 
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com.
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.



[Proto-Scripty] Re: Stopping events ..

2009-03-21 Thread T.J. Crowder

Hi,

 Very strange but I'll take your word on it.

 Although I can't say I understand why the object wouldn't throw its
 submit event after executing the submit method.

Because by design, submitting a form programatically doesn't fire the
onsubmit event.  I think this is on the theory that if you're doing it
with code, you've already done whatever checks you want to do.  This
is not well documented as far as I can tell, but is the case on every
browser I've ever tried it on.
--
T.J. Crowder
tj / crowder software / com
Independent Software Engineer, consulting services available


On Mar 19, 7:24 pm, Matt Foster mattfoste...@gmail.com wrote:
 Very strange but I'll take your word on it.

 Although I can't say I understand why the object wouldn't throw its
 submit event after executing the submit method.

 If another method, one that isn't handling the event called the submit
 method, would it be caught by the submit listener?

 --

 http://positionabsolute.net

 On Mar 19, 12:03 pm, Marko Zabcic gm.ma...@gmail.com wrote:

  You can also do this:

  $('foo').observe('submit',function(evt){
                  evt.stop(); //shorter way
                  console.log('bar');
                  this.submit();
          });

  On Mar 18, 11:45 pm, Alex Mcauley webmas...@thecarmarketplace.com
  wrote:

   There is no exception or error thrown in firebug !!

   I went round it with an inline call instead !

   Thanks for help guys

   Alex

   - Original Message -
   From: Matt Foster mattfoste...@gmail.com
   To: Prototype  script.aculo.us 
   prototype-scriptaculous@googlegroups.com
   Sent: Wednesday, March 18, 2009 8:26 PM
   Subject: [Proto-Scripty] Re: Stopping events ..

   Event.stop(e) does indeed prevent event propagation.  I would assume
   that your code is hitting an exception before Event.stop is being
   executed.

Try calling Event.stop() at the very beginning of the script, before
anything else, then if there are no errors, call event.form.submit()
to carry on with the original submit event.

   @Walter: If you have a submit handler that executes the object's
   submit event wouldn't this lead to an infinite loop?
   Wouldn't the idea be, catch the submit event, validate the fields, if
   all is valid, allow the event to proceed, if its not then stop the
   event.

   function handleLoad(){

      $(myForm).observe(submit, function(e){

      var invalidArr = $(myForm).select(input.req, textarea.req,
   select.req).findAll(function(element){ return element.value !=  });
      if(invalidArr.length  0){
           e.stop(); //prototype 1.6 code to event stop.
           handleInvalids(invalidArr )
      }
   });

   }

   Event.observe(window, load, handleLoad);

   --

  http://positionabsolute.net

   On Mar 18, 11:59 am, Walter Lee Davis wa...@wdstudio.com wrote:
Try calling Event.stop() at the very beginning of the script, before
anything else, then if there are no errors, call event.form.submit()
to carry on with the original submit event.

Walter

On Mar 18, 2009, at 11:45 AM, Alex Mcauley wrote:

 It still does not work with Event.stop(event); for some reason 

 i even tried changing the code to .

 var error='';
 $$('.req').each(function(e) {

 if($(e).value=='') {
 error+='Required';

 }

 });
 if(error.length=1) {
 alert(error)
 Event.stop(event); // does not work

 }

 - Original Message -
 From: Alex Mcauley webmas...@thecarmarketplace.com
 To: prototype-scriptaculous@googlegroups.com
 Sent: Wednesday, March 18, 2009 3:42 PM
 Subject: [Proto-Scripty] Re: Stopping events ..

 Doh !! i knew it was something simple !!

 Thanks
 Alex
 - Original Message -
 From: Walter Lee Davis wa...@wdstudio.com
 To: prototype-scriptaculous@googlegroups.com
 Sent: Wednesday, March 18, 2009 3:11 PM
 Subject: [Proto-Scripty] Re: Stopping events ..

 Has to be capital E event:

 Event.stop(event)

 Walter

 On Mar 18, 2009, at 10:40 AM, Jeztah wrote:

 event.stop(event); // doesnt stop the request from firing


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Stopping events ..

2009-03-19 Thread Marko Zabcic

You can also do this:

$('foo').observe('submit',function(evt){
evt.stop(); //shorter way
console.log('bar');
this.submit();
});

On Mar 18, 11:45 pm, Alex Mcauley webmas...@thecarmarketplace.com
wrote:
 There is no exception or error thrown in firebug !!

 I went round it with an inline call instead !

 Thanks for help guys

 Alex

 - Original Message -
 From: Matt Foster mattfoste...@gmail.com
 To: Prototype  script.aculo.us prototype-scriptaculous@googlegroups.com
 Sent: Wednesday, March 18, 2009 8:26 PM
 Subject: [Proto-Scripty] Re: Stopping events ..

 Event.stop(e) does indeed prevent event propagation.  I would assume
 that your code is hitting an exception before Event.stop is being
 executed.

  Try calling Event.stop() at the very beginning of the script, before
  anything else, then if there are no errors, call event.form.submit()
  to carry on with the original submit event.

 @Walter: If you have a submit handler that executes the object's
 submit event wouldn't this lead to an infinite loop?
 Wouldn't the idea be, catch the submit event, validate the fields, if
 all is valid, allow the event to proceed, if its not then stop the
 event.

 function handleLoad(){

    $(myForm).observe(submit, function(e){

    var invalidArr = $(myForm).select(input.req, textarea.req,
 select.req).findAll(function(element){ return element.value !=  });
    if(invalidArr.length  0){
         e.stop(); //prototype 1.6 code to event stop.
         handleInvalids(invalidArr )
    }
 });

 }

 Event.observe(window, load, handleLoad);

 --

 http://positionabsolute.net

 On Mar 18, 11:59 am, Walter Lee Davis wa...@wdstudio.com wrote:
  Try calling Event.stop() at the very beginning of the script, before
  anything else, then if there are no errors, call event.form.submit()
  to carry on with the original submit event.

  Walter

  On Mar 18, 2009, at 11:45 AM, Alex Mcauley wrote:

   It still does not work with Event.stop(event); for some reason 

   i even tried changing the code to .

   var error='';
   $$('.req').each(function(e) {

   if($(e).value=='') {
   error+='Required';

   }

   });
   if(error.length=1) {
   alert(error)
   Event.stop(event); // does not work

   }

   - Original Message -
   From: Alex Mcauley webmas...@thecarmarketplace.com
   To: prototype-scriptaculous@googlegroups.com
   Sent: Wednesday, March 18, 2009 3:42 PM
   Subject: [Proto-Scripty] Re: Stopping events ..

   Doh !! i knew it was something simple !!

   Thanks
   Alex
   - Original Message -
   From: Walter Lee Davis wa...@wdstudio.com
   To: prototype-scriptaculous@googlegroups.com
   Sent: Wednesday, March 18, 2009 3:11 PM
   Subject: [Proto-Scripty] Re: Stopping events ..

   Has to be capital E event:

   Event.stop(event)

   Walter

   On Mar 18, 2009, at 10:40 AM, Jeztah wrote:

   event.stop(event); // doesnt stop the request from firing

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Stopping events ..

2009-03-19 Thread Matt Foster

Very strange but I'll take your word on it.

Although I can't say I understand why the object wouldn't throw its
submit event after executing the submit method.

If another method, one that isn't handling the event called the submit
method, would it be caught by the submit listener?

--

http://positionabsolute.net



On Mar 19, 12:03 pm, Marko Zabcic gm.ma...@gmail.com wrote:
 You can also do this:

 $('foo').observe('submit',function(evt){
                 evt.stop(); //shorter way
                 console.log('bar');
                 this.submit();
         });

 On Mar 18, 11:45 pm, Alex Mcauley webmas...@thecarmarketplace.com
 wrote:

  There is no exception or error thrown in firebug !!

  I went round it with an inline call instead !

  Thanks for help guys

  Alex

  - Original Message -
  From: Matt Foster mattfoste...@gmail.com
  To: Prototype  script.aculo.us prototype-scriptaculous@googlegroups.com
  Sent: Wednesday, March 18, 2009 8:26 PM
  Subject: [Proto-Scripty] Re: Stopping events ..

  Event.stop(e) does indeed prevent event propagation.  I would assume
  that your code is hitting an exception before Event.stop is being
  executed.

   Try calling Event.stop() at the very beginning of the script, before
   anything else, then if there are no errors, call event.form.submit()
   to carry on with the original submit event.

  @Walter: If you have a submit handler that executes the object's
  submit event wouldn't this lead to an infinite loop?
  Wouldn't the idea be, catch the submit event, validate the fields, if
  all is valid, allow the event to proceed, if its not then stop the
  event.

  function handleLoad(){

     $(myForm).observe(submit, function(e){

     var invalidArr = $(myForm).select(input.req, textarea.req,
  select.req).findAll(function(element){ return element.value !=  });
     if(invalidArr.length  0){
          e.stop(); //prototype 1.6 code to event stop.
          handleInvalids(invalidArr )
     }
  });

  }

  Event.observe(window, load, handleLoad);

  --

 http://positionabsolute.net

  On Mar 18, 11:59 am, Walter Lee Davis wa...@wdstudio.com wrote:
   Try calling Event.stop() at the very beginning of the script, before
   anything else, then if there are no errors, call event.form.submit()
   to carry on with the original submit event.

   Walter

   On Mar 18, 2009, at 11:45 AM, Alex Mcauley wrote:

It still does not work with Event.stop(event); for some reason 

i even tried changing the code to .

var error='';
$$('.req').each(function(e) {

if($(e).value=='') {
error+='Required';

}

});
if(error.length=1) {
alert(error)
Event.stop(event); // does not work

}

- Original Message -
From: Alex Mcauley webmas...@thecarmarketplace.com
To: prototype-scriptaculous@googlegroups.com
Sent: Wednesday, March 18, 2009 3:42 PM
Subject: [Proto-Scripty] Re: Stopping events ..

Doh !! i knew it was something simple !!

Thanks
Alex
- Original Message -
From: Walter Lee Davis wa...@wdstudio.com
To: prototype-scriptaculous@googlegroups.com
Sent: Wednesday, March 18, 2009 3:11 PM
Subject: [Proto-Scripty] Re: Stopping events ..

Has to be capital E event:

Event.stop(event)

Walter

On Mar 18, 2009, at 10:40 AM, Jeztah wrote:

event.stop(event); // doesnt stop the request from firing
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Stopping events ..

2009-03-19 Thread Walter Lee Davis

Here's my test:

//valid page wrapped around this, latest prototype linked from google.

form action= id=foo method=get accept-charset=utf-8
pinput type=submit value=Test//p
/form
divpa href=# id=barTest Submit/a/p/div
script type=text/javascript charset=utf-8
$('foo').observe('submit',function(evt){
Event.stop(evt);
console.log(evt.element().id);
alert(evt.element().id)
$('foo').submit();
});
$('bar').observe('click',function(evt){
Event.stop(evt);
$('foo').submit();
})
/script

Clicking on the form button fires the alert and reports that 'foo' was  
the event element there and in the console. Clicking on a#bar submits  
the form without passing Go, collecting $200, or anything else  
console- or alert-related happening.

Tested in Firefox 2.latest and Safari 3.latest.

Walter

On Mar 19, 2009, at 3:24 PM, Matt Foster wrote:


 Very strange but I'll take your word on it.

 Although I can't say I understand why the object wouldn't throw its
 submit event after executing the submit method.

 If another method, one that isn't handling the event called the submit
 method, would it be caught by the submit listener?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Stopping events ..

2009-03-18 Thread Walter Lee Davis

Has to be capital E event:

Event.stop(event)

Walter

On Mar 18, 2009, at 10:40 AM, Jeztah wrote:

   event.stop(event); // doesnt stop the request from firing


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Stopping events ..

2009-03-18 Thread Alex Mcauley

Doh !! i knew it was something simple !!

Thanks
Alex
- Original Message - 
From: Walter Lee Davis wa...@wdstudio.com
To: prototype-scriptaculous@googlegroups.com
Sent: Wednesday, March 18, 2009 3:11 PM
Subject: [Proto-Scripty] Re: Stopping events ..



 Has to be capital E event:

 Event.stop(event)

 Walter

 On Mar 18, 2009, at 10:40 AM, Jeztah wrote:

 event.stop(event); // doesnt stop the request from firing


 
 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Stopping events ..

2009-03-18 Thread Alex Mcauley

It still does not work with Event.stop(event); for some reason 


i even tried changing the code to .

 var error='';
 $$('.req').each(function(e) {

   if($(e).value=='') {
error+='Required';

}

});
 if(error.length=1) {
  alert(error)
  Event.stop(event); // does not work

 }




- Original Message - 
From: Alex Mcauley webmas...@thecarmarketplace.com
To: prototype-scriptaculous@googlegroups.com
Sent: Wednesday, March 18, 2009 3:42 PM
Subject: [Proto-Scripty] Re: Stopping events ..



 Doh !! i knew it was something simple !!

 Thanks
 Alex
 - Original Message - 
 From: Walter Lee Davis wa...@wdstudio.com
 To: prototype-scriptaculous@googlegroups.com
 Sent: Wednesday, March 18, 2009 3:11 PM
 Subject: [Proto-Scripty] Re: Stopping events ..



 Has to be capital E event:

 Event.stop(event)

 Walter

 On Mar 18, 2009, at 10:40 AM, Jeztah wrote:

 event.stop(event); // doesnt stop the request from firing


 



 
 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Stopping events ..

2009-03-18 Thread Alex Mcauley

So the crazy thing is  if i remove it from the Event.observe(window  
wrapper it seems to work and if i functionise it and place the function 
outside the wrapper and add onsubmit=return theFunction(); to the form it 
works 

Not really to sure whats going on here but i would like to avoid inline JS 
if i can - if it cant be done then i will haveto use inline


Alex


- Original Message - 
From: Alex Mcauley webmas...@thecarmarketplace.com
To: prototype-scriptaculous@googlegroups.com
Sent: Wednesday, March 18, 2009 3:45 PM
Subject: [Proto-Scripty] Re: Stopping events ..



 It still does not work with Event.stop(event); for some reason 


 i even tried changing the code to .

 var error='';
 $$('.req').each(function(e) {

   if($(e).value=='') {
error+='Required';

 }

 });
 if(error.length=1) {
  alert(error)
  Event.stop(event); // does not work

 }




 - Original Message - 
 From: Alex Mcauley webmas...@thecarmarketplace.com
 To: prototype-scriptaculous@googlegroups.com
 Sent: Wednesday, March 18, 2009 3:42 PM
 Subject: [Proto-Scripty] Re: Stopping events ..



 Doh !! i knew it was something simple !!

 Thanks
 Alex
 - Original Message - 
 From: Walter Lee Davis wa...@wdstudio.com
 To: prototype-scriptaculous@googlegroups.com
 Sent: Wednesday, March 18, 2009 3:11 PM
 Subject: [Proto-Scripty] Re: Stopping events ..



 Has to be capital E event:

 Event.stop(event)

 Walter

 On Mar 18, 2009, at 10:40 AM, Jeztah wrote:

 event.stop(event); // doesnt stop the request from firing


 



 



 
 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Stopping events ..

2009-03-18 Thread Walter Lee Davis

Try calling Event.stop() at the very beginning of the script, before  
anything else, then if there are no errors, call event.form.submit()  
to carry on with the original submit event.

Walter

On Mar 18, 2009, at 11:45 AM, Alex Mcauley wrote:


 It still does not work with Event.stop(event); for some reason 


 i even tried changing the code to .

 var error='';
 $$('.req').each(function(e) {

   if($(e).value=='') {
error+='Required';

 }

 });
 if(error.length=1) {
  alert(error)
  Event.stop(event); // does not work

 }




 - Original Message -
 From: Alex Mcauley webmas...@thecarmarketplace.com
 To: prototype-scriptaculous@googlegroups.com
 Sent: Wednesday, March 18, 2009 3:42 PM
 Subject: [Proto-Scripty] Re: Stopping events ..



 Doh !! i knew it was something simple !!

 Thanks
 Alex
 - Original Message -
 From: Walter Lee Davis wa...@wdstudio.com
 To: prototype-scriptaculous@googlegroups.com
 Sent: Wednesday, March 18, 2009 3:11 PM
 Subject: [Proto-Scripty] Re: Stopping events ..



 Has to be capital E event:

 Event.stop(event)

 Walter

 On Mar 18, 2009, at 10:40 AM, Jeztah wrote:

 event.stop(event); // doesnt stop the request from firing










 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Stopping events ..

2009-03-18 Thread Matt Foster

Event.stop(e) does indeed prevent event propagation.  I would assume
that your code is hitting an exception before Event.stop is being
executed.

 Try calling Event.stop() at the very beginning of the script, before
 anything else, then if there are no errors, call event.form.submit()
 to carry on with the original submit event.

@Walter: If you have a submit handler that executes the object's
submit event wouldn't this lead to an infinite loop?
Wouldn't the idea be, catch the submit event, validate the fields, if
all is valid, allow the event to proceed, if its not then stop the
event.

function handleLoad(){

   $(myForm).observe(submit, function(e){

   var invalidArr = $(myForm).select(input.req, textarea.req,
select.req).findAll(function(element){ return element.value !=  });
   if(invalidArr.length  0){
e.stop(); //prototype 1.6 code to event stop.
handleInvalids(invalidArr )
   }
});

}

Event.observe(window, load, handleLoad);


--

http://positionabsolute.net

On Mar 18, 11:59 am, Walter Lee Davis wa...@wdstudio.com wrote:
 Try calling Event.stop() at the very beginning of the script, before  
 anything else, then if there are no errors, call event.form.submit()  
 to carry on with the original submit event.

 Walter

 On Mar 18, 2009, at 11:45 AM, Alex Mcauley wrote:



  It still does not work with Event.stop(event); for some reason 

  i even tried changing the code to .

  var error='';
  $$('.req').each(function(e) {

    if($(e).value=='') {
     error+='Required';

  }

  });
  if(error.length=1) {
   alert(error)
   Event.stop(event); // does not work

  }

  - Original Message -
  From: Alex Mcauley webmas...@thecarmarketplace.com
  To: prototype-scriptaculous@googlegroups.com
  Sent: Wednesday, March 18, 2009 3:42 PM
  Subject: [Proto-Scripty] Re: Stopping events ..

  Doh !! i knew it was something simple !!

  Thanks
  Alex
  - Original Message -
  From: Walter Lee Davis wa...@wdstudio.com
  To: prototype-scriptaculous@googlegroups.com
  Sent: Wednesday, March 18, 2009 3:11 PM
  Subject: [Proto-Scripty] Re: Stopping events ..

  Has to be capital E event:

  Event.stop(event)

  Walter

  On Mar 18, 2009, at 10:40 AM, Jeztah wrote:

  event.stop(event); // doesnt stop the request from firing
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Stopping events ..

2009-03-18 Thread Walter Lee Davis

Not in my experience, no. But I could just have been lucky so far.

Walter

On Mar 18, 2009, at 4:26 PM, Matt Foster wrote:

 @Walter: If you have a submit handler that executes the object's
 submit event wouldn't this lead to an infinite loop?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Stopping events ..

2009-03-18 Thread Walter Lee Davis

Just tested this assertion, and the following just submits the form,  
as you'd expect, without a loop being created.

$('foo').observe('submit',function(evt){
Event.stop(evt);
console.log('bar');
this.submit();
});

Walter

On Mar 18, 2009, at 4:45 PM, Walter Lee Davis wrote:


 Not in my experience, no. But I could just have been lucky so far.

 Walter

 On Mar 18, 2009, at 4:26 PM, Matt Foster wrote:

 @Walter: If you have a submit handler that executes the object's
 submit event wouldn't this lead to an infinite loop?


 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Stopping events ..

2009-03-18 Thread Alex Mcauley

There is no exception or error thrown in firebug !!

I went round it with an inline call instead !

Thanks for help guys

Alex

- Original Message - 
From: Matt Foster mattfoste...@gmail.com
To: Prototype  script.aculo.us prototype-scriptaculous@googlegroups.com
Sent: Wednesday, March 18, 2009 8:26 PM
Subject: [Proto-Scripty] Re: Stopping events ..



Event.stop(e) does indeed prevent event propagation.  I would assume
that your code is hitting an exception before Event.stop is being
executed.

 Try calling Event.stop() at the very beginning of the script, before
 anything else, then if there are no errors, call event.form.submit()
 to carry on with the original submit event.

@Walter: If you have a submit handler that executes the object's
submit event wouldn't this lead to an infinite loop?
Wouldn't the idea be, catch the submit event, validate the fields, if
all is valid, allow the event to proceed, if its not then stop the
event.

function handleLoad(){

   $(myForm).observe(submit, function(e){

   var invalidArr = $(myForm).select(input.req, textarea.req,
select.req).findAll(function(element){ return element.value !=  });
   if(invalidArr.length  0){
e.stop(); //prototype 1.6 code to event stop.
handleInvalids(invalidArr )
   }
});

}

Event.observe(window, load, handleLoad);


--

http://positionabsolute.net

On Mar 18, 11:59 am, Walter Lee Davis wa...@wdstudio.com wrote:
 Try calling Event.stop() at the very beginning of the script, before
 anything else, then if there are no errors, call event.form.submit()
 to carry on with the original submit event.

 Walter

 On Mar 18, 2009, at 11:45 AM, Alex Mcauley wrote:



  It still does not work with Event.stop(event); for some reason 

  i even tried changing the code to .

  var error='';
  $$('.req').each(function(e) {

  if($(e).value=='') {
  error+='Required';

  }

  });
  if(error.length=1) {
  alert(error)
  Event.stop(event); // does not work

  }

  - Original Message -
  From: Alex Mcauley webmas...@thecarmarketplace.com
  To: prototype-scriptaculous@googlegroups.com
  Sent: Wednesday, March 18, 2009 3:42 PM
  Subject: [Proto-Scripty] Re: Stopping events ..

  Doh !! i knew it was something simple !!

  Thanks
  Alex
  - Original Message -
  From: Walter Lee Davis wa...@wdstudio.com
  To: prototype-scriptaculous@googlegroups.com
  Sent: Wednesday, March 18, 2009 3:11 PM
  Subject: [Proto-Scripty] Re: Stopping events ..

  Has to be capital E event:

  Event.stop(event)

  Walter

  On Mar 18, 2009, at 10:40 AM, Jeztah wrote:

  event.stop(event); // doesnt stop the request from firing



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---