[Proto-Scripty] Re: Observing a checkbox
On Aug 13, 2:53 pm, Jeztah webmas...@thecarmarketplace.com wrote: What is the correct Cross browser way to observe a checkbox being checked or not I am using $('hidenonlive').observe('change',function() { if($('hidenonlive').checked!==true) { alert('Showing'); } else { $$('.dead-vacancy').invoke('hide'); } }); But it doesnt seem to want to work in IE8 and it doesnt throw an error SHoudl i just use click instead? You are tabbing to a different field after clicking, yes? The definition of 'onChange' in the HTML spec (http://www.w3.org/TR/ html401/interact/scripts.html#adef-onchange) is The onchange event occurs when a control loses the input focus and its value has been modified since gaining focus. --~--~-~--~~~---~--~~ 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: Observing a checkbox
Spec and reality often differ. On 8/18/09, ColinFine colin.f...@pace.com wrote: On Aug 13, 2:53 pm, Jeztah webmas...@thecarmarketplace.com wrote: What is the correct Cross browser way to observe a checkbox being checked or not I am using $('hidenonlive').observe('change',function() { if($('hidenonlive').checked!==true) { alert('Showing'); } else { $$('.dead-vacancy').invoke('hide'); } }); But it doesnt seem to want to work in IE8 and it doesnt throw an error SHoudl i just use click instead? You are tabbing to a different field after clicking, yes? The definition of 'onChange' in the HTML spec (http://www.w3.org/TR/ html401/interact/scripts.html#adef-onchange) is The onchange event occurs when a control loses the input focus and its value has been modified since gaining focus. -- Sent from my mobile device --~--~-~--~~~---~--~~ 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: Observing a checkbox
Yep, too many browser differences, use click. Some browsers fire onchange event as soon as you change the value, others (IE in fact) only fire the event after the checkbox loses focus. Good explanation here: http://video.yahoo.com/watch/4943143/13163203 (at about time -41:46). regards, - Kev DJ Mangus wrote: Spec and reality often differ. On 8/18/09, ColinFine colin.f...@pace.com wrote: On Aug 13, 2:53 pm, Jeztah webmas...@thecarmarketplace.com wrote: What is the correct Cross browser way to observe a checkbox being checked or not I am using $('hidenonlive').observe('change',function() { if($('hidenonlive').checked!==true) { alert('Showing'); } else { $$('.dead-vacancy').invoke('hide'); } }); But it doesnt seem to want to work in IE8 and it doesnt throw an error SHoudl i just use click instead? You are tabbing to a different field after clicking, yes? The definition of 'onChange' in the HTML spec (http://www.w3.org/TR/ html401/interact/scripts.html#adef-onchange) is The onchange event occurs when a control loses the input focus and its value has been modified since gaining focus. -- Kevin Porter Advanced Web Construction Ltd http://webutils.co.uk http://billiardsearch.net http://9ballpool.co.uk AJAX Blackjack - real-time multi-player blackjack game with no flash, java or software downloads required - http://blackjack.webutils.co.uk --~--~-~--~~~---~--~~ 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: Observing a checkbox
Thanks TJ... I figured it was worth just using click in the end just to be on the safe side! Alex Mcauley http://www.thevacancymarket.com - Original Message - From: T.J. Crowder t...@crowdersoftware.com To: Prototype script.aculo.us prototype-scriptaculous@googlegroups.com Sent: Friday, August 14, 2009 10:55 AM Subject: [Proto-Scripty] Re: Observing a checkbox Hi, FWIW, the Abstract.EventObserver class in Prototype uses click, see lines 3,762-3,764 of 1.6.0.3. I've typically used click and haven't run into issues. -- T.J. Crowder tj / crowder software / com Independent Software Engineer, consulting services available On Aug 13, 4:03 pm, Alex McAuley webmas...@thecarmarketplace.com wrote: Thanks Douglas My way works fine... That is not the issue... the issue is with change or click Thanks Alex Mcauleyhttp://www.thevacancymarket.com - Original Message - From: Douglas douglas.gont...@gmail.com To: prototype-scriptaculous@googlegroups.com Sent: Thursday, August 13, 2009 3:35 PM Subject: [Proto-Scripty] Re: Observing a checkbox checked === true is wrong you should check for ('checked' == $(input).checked || true == $(input).checked) ps: untested On Thu, Aug 13, 2009 at 10:53 AM, Jeztahwebmas...@thecarmarketplace.com wrote: What is the correct Cross browser way to observe a checkbox being checked or not I am using $('hidenonlive').observe('change',function() { if($('hidenonlive').checked!==true) { alert('Showing'); } else { $$('.dead-vacancy').invoke('hide'); } }); But it doesnt seem to want to work in IE8 and it doesnt throw an error SHoudl i just use click instead? Thanks in advance ALex -- Believe nothing, no matter where you read it, or who said it, no matter if I have said it, unless it agrees with your own reason and your own common sense. --~--~-~--~~~---~--~~ 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: Observing a checkbox
Hi, FWIW, the Abstract.EventObserver class in Prototype uses click, see lines 3,762-3,764 of 1.6.0.3. I've typically used click and haven't run into issues. -- T.J. Crowder tj / crowder software / com Independent Software Engineer, consulting services available On Aug 13, 4:03 pm, Alex McAuley webmas...@thecarmarketplace.com wrote: Thanks Douglas My way works fine... That is not the issue... the issue is with change or click Thanks Alex Mcauleyhttp://www.thevacancymarket.com - Original Message - From: Douglas douglas.gont...@gmail.com To: prototype-scriptaculous@googlegroups.com Sent: Thursday, August 13, 2009 3:35 PM Subject: [Proto-Scripty] Re: Observing a checkbox checked === true is wrong you should check for ('checked' == $(input).checked || true == $(input).checked) ps: untested On Thu, Aug 13, 2009 at 10:53 AM, Jeztahwebmas...@thecarmarketplace.com wrote: What is the correct Cross browser way to observe a checkbox being checked or not I am using $('hidenonlive').observe('change',function() { if($('hidenonlive').checked!==true) { alert('Showing'); } else { $$('.dead-vacancy').invoke('hide'); } }); But it doesnt seem to want to work in IE8 and it doesnt throw an error SHoudl i just use click instead? Thanks in advance ALex -- Believe nothing, no matter where you read it, or who said it, no matter if I have said it, unless it agrees with your own reason and your own common sense. --~--~-~--~~~---~--~~ 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: Observing a checkbox
checked === true is wrong you should check for ('checked' == $(input).checked || true == $(input).checked) ps: untested On Thu, Aug 13, 2009 at 10:53 AM, Jeztahwebmas...@thecarmarketplace.com wrote: What is the correct Cross browser way to observe a checkbox being checked or not I am using $('hidenonlive').observe('change',function() { if($('hidenonlive').checked!==true) { alert('Showing'); } else { $$('.dead-vacancy').invoke('hide'); } }); But it doesnt seem to want to work in IE8 and it doesnt throw an error SHoudl i just use click instead? Thanks in advance ALex -- Believe nothing, no matter where you read it, or who said it, no matter if I have said it, unless it agrees with your own reason and your own common sense. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---