I am not a Ruby user, but I was hoping that maybe you guys could help me with the some Javascript. I am using Prototype and Scriptaculous. First off this is what I am trying to do: I have a table based form A that has 6 yes/no questions using radio buttons. I have put these questions in a separate <tbody> because using a div doesn''t work for tables. If a user selects yes to any of these questions I would like for Form B to automatically appear below these questions. Sounds simple, but I am having some trouble. Here''s is where I am at: I added id''s to all of the radio buttons. Then I created an external js file, and then am calling it at the end of my page. In this external js file I have the following: [ <script type="text/javascript" language="javascript"> var checkConflict = function checkConflict(){ $(''test'').toggle(); } Event.observe(window,''load'',function() { Event.observe(''element1'', ''click'', function(){ checkConflict(); }); Event.observe(''element2'', ''click'', function(){ checkConflict(); }); Event.observe(''element3'', ''click'', function(){ checkConflict(); }); Event.observe(''element4'', ''click'', function(){ checkConflict(); }); Event.observe(''element5'', ''click'', function(){ checkConflict(); }); Event.observe(''element6'', ''click'', function(){ checkConflict(); }); }); </script> ] So far so good, this works to show the questions whenever they click yes. However I have two problems: 1. One is in firefox 2.0.0.11 I am getting this error: "Element referenced by ID/NAME in the global scope. Use W3C standard document.getElementById() instead. undefined... 2. The second problem I have is that if they select yes a second time it hides the questions. I seem to be having a logic problem. It has been suggested that I used element.observe, element.toggle, and also bind. But I don''t really know how to do this. I have searched everywhere trying to find a relevant example, and so far I have turned up nothing. So if anyone has any ideas or can help it would be greatly appreciated. I apologize if this doesn''t make sense. Please let me know if I have made a mistake somewhere, or if you need more info. I would post a link for you, but I am working on a private server, so I can''t do that, but if you need something clarified please let me know. Thank you in advance. ~Becca --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
I would probably tackle the problem like this: <script type=''text/javascript''> Event.observe(window, ''load'', function () { function toggleForm () { $(''toShow'')[ $(''radios'').select(''input[type=radio] [value=yes]'').pluck(''checked'').any() ? ''show'' : ''hide'' ](); } $(''radios'').observe(''click'', toggleForm); toggleForm(); }); </script> <form> <table> <tbody id=''radios''> <tr> <td><input type=''RADIO'' name=''option1'' value=''yes'' />Yes</td><td><input type=''RADIO'' name=''option1'' value=''no'' />No</td></tr> <tr> <td><input type=''RADIO'' name=''option2'' value=''yes'' />Yes</td><td><input type=''RADIO'' name=''option2'' value=''no'' />No</td></tr> <tr> <td><input type=''RADIO'' name=''option3'' value=''yes'' />Yes</td><td><input type=''RADIO'' name=''option3'' value=''no'' />No</td></tr> </tbody> </table> </form> On Jan 30, 8:08 am, kodiacat <kodia...-/E1597aS9LQAvxtiuMwx3w@public.gmane.org> wrote:> I am not a Ruby user, but I was hoping that maybe you guys could help > me with the some Javascript. I am using Prototype and Scriptaculous. > First off this is what I am trying to do: I have a table based form > A that has 6 yes/no questions using radio buttons. I have put these > questions in a separate <tbody> because using a div doesn''t work for > tables. If a user selects yes to any of these questions I would like > for Form B to automatically appear below these questions. Sounds > simple, but I am having some trouble. > > Here''s is where I am at: > I added id''s to all of the radio buttons. > Then I created an external js file, and then am calling it at the end > of my page. > In this external js file I have the following: > > [ > <script type="text/javascript" language="javascript"> > > var checkConflict = function checkConflict(){ > $(''test'').toggle(); > > } > > Event.observe(window,''load'',function() > { > Event.observe(''element1'', ''click'', function(){ checkConflict(); > }); > Event.observe(''element2'', ''click'', function(){ checkConflict(); > }); > Event.observe(''element3'', ''click'', function(){ checkConflict(); > }); > Event.observe(''element4'', ''click'', function(){ checkConflict(); > }); > Event.observe(''element5'', ''click'', function(){ checkConflict(); > }); > Event.observe(''element6'', ''click'', function(){ checkConflict(); > }); > > }); > > </script> > ] > So far so good, this works to show the questions whenever they click > yes. However I have two problems: > > 1. One is in firefox 2.0.0.11 I am getting this error: > "Element referenced by ID/NAME in the global scope. Use W3C standard > document.getElementById() instead. undefined... > > 2. The second problem I have is that if they select yes a > second time it hides the questions. > > I seem to be having a logic problem. It has been suggested that I used > element.observe, element.toggle, and also bind. But I don''t really > know how to do this. > I have searched everywhere trying to find a relevant example, and so > far I have turned up nothing. > > So if anyone has any ideas or can help it would be greatly > appreciated. I apologize if this doesn''t make sense. Please let me > know if I have made a mistake somewhere, or if you need more info. I > would post a link for you, but I am working on a private server, so I > can''t do that, but if you need something clarified please let me > know. Thank you in advance. > ~Becca--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Wow, that''s one crazy ternary right there... Of course we can obfuscate it even more: Event.observe(window, ''load'', function () { $(''radios'').observe(''click'', (function() { $(''toShow'')[$(''#radios input:checked[type=radio] [value=yes]'').length ? ''show'' : ''hide''](); })()); }); j/k --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Thank you for the response. Oh my, I''m not sure I understand this. I think that you are suggesting to place the radio buttons in a <tbody> also. This is good idea, I had been trying to go about it for each individual element...something like below... Which is probably a horrible way to do it....which explains why I haven''t been able to figure this out(*blush). Your approach seems like it is a much better way, if I can just figure it out.. There seem to be several things there that I haven''t used before... Such as pluck, any, and select..? And Also Im not sure what the ? and colon are for.... I apologize if I am not making much since, or if I ask a stupid question. My brain is a bit fuzzy at the moment, and....I''m a newbie. Thank you again. ~Becca~ if (document.getElementsByName(''element1'').value == ''Yes'') { $(''form_B'').show(); } else (document.getElementsByName(''element1'').value == ''No'') { $(''form_B'').hide(); } } On Jan 30, 1:42 pm, Nycto <NyctoFi...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I would probably tackle the problem like this: > > <script type=''text/javascript''> > > Event.observe(window, ''load'', function () { > > function toggleForm () { > $(''toShow'')[ $(''radios'').select(''input[type=radio] > [value=yes]'').pluck(''checked'').any() ? ''show'' : ''hide'' ](); > } > $(''radios'').observe(''click'', toggleForm); > toggleForm(); > > }); > > </script> > <form> > <table> > <tbody id=''radios''> > <tr> > <td><input type=''RADIO'' name=''option1'' value=''yes'' />Yes</td> > > <td><input type=''RADIO'' name=''option1'' value=''no'' />No</td> > > </tr> > <tr> > <td><input type=''RADIO'' name=''option2'' value=''yes'' />Yes</td> > > <td><input type=''RADIO'' name=''option2'' value=''no'' />No</td> > > </tr> > <tr> > <td><input type=''RADIO'' name=''option3'' value=''yes'' />Yes</td> > > <td><input type=''RADIO'' name=''option3'' value=''no'' />No</td> > > </tr> > </tbody> > </table> > </form> > > On Jan 30, 8:08 am, kodiacat <kodia...-/E1597aS9LQAvxtiuMwx3w@public.gmane.org> wrote: > > > I am not a Ruby user, but I was hoping that maybe you guys could help > > me with the some Javascript. I am using Prototype and Scriptaculous. > > First off this is what I am trying to do: I have a table based form > > A that has 6 yes/no questions using radio buttons. I have put these > > questions in a separate <tbody> because using a div doesn''t work for > > tables. If a user selects yes to any of these questions I would like > > for Form B to automatically appear below these questions. Sounds > > simple, but I am having some trouble. > > > Here''s is where I am at: > > I added id''s to all of the radio buttons. > > Then I created an external js file, and then am calling it at the end > > of my page. > > In this external js file I have the following: > > > [ > > <script type="text/javascript" language="javascript"> > > > var checkConflict = function checkConflict(){ > > $(''test'').toggle(); > > > } > > > Event.observe(window,''load'',function() > > { > > Event.observe(''element1'', ''click'', function(){ checkConflict(); > > }); > > Event.observe(''element2'', ''click'', function(){ checkConflict(); > > }); > > Event.observe(''element3'', ''click'', function(){ checkConflict(); > > }); > > Event.observe(''element4'', ''click'', function(){ checkConflict(); > > }); > > Event.observe(''element5'', ''click'', function(){ checkConflict(); > > }); > > Event.observe(''element6'', ''click'', function(){ checkConflict(); > > }); > > > }); > > > </script> > > ] > > So far so good, this works to show the questions whenever they click > > yes. However I have two problems: > > > 1. One is in firefox 2.0.0.11 I am getting this error: > > "Element referenced by ID/NAME in the global scope. Use W3C standard > > document.getElementById() instead. undefined... > > > 2. The second problem I have is that if they select yes a > > second time it hides the questions. > > > I seem to be having a logic problem. It has been suggested that I used > > element.observe, element.toggle, and also bind. But I don''t really > > know how to do this. > > I have searched everywhere trying to find a relevant example, and so > > far I have turned up nothing. > > > So if anyone has any ideas or can help it would be greatly > > appreciated. I apologize if this doesn''t make sense. Please let me > > know if I have made a mistake somewhere, or if you need more info. I > > would post a link for you, but I am working on a private server, so I > > can''t do that, but if you need something clarified please let me > > know. Thank you in advance. > > ~Becca--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
> Of course we can obfuscate it even more:Heck, we should just encode it and slap it in an eval> Oh my, I''m not sure I understand thisI apologize... I wasn''t trying to confuse you, just write some compact code that you could drop in. Here is a more thoroughly documented version of the exact same thing: <script type=''text/javascript''> // Attach an observer to the window Event.observe(window, ''load'', function () { // Create a function inside this scope for toggling the form function toggleForm () { var areAnyYes // Grab the "#radios" TBODY element $(''radios'') // Using a CSS selector, get an array of all the // input elements where the "value" attribute is "yes" .select(''input[type=radio][value=yes]'') // For each of the radio buttons found, pull the // "checked" property .pluck(''checked'') // find out if any of those "checked" properties are true .any(); // If we found any "yes" checkboxes that were checked, // show the form if ( areAnyYes ) $(''toShow'').show(); else $(''toShow'').hide(); } // Add an observer to the TBODY that will run the // above toggleForm function. It will fire anytime someone // clicks on one of the radio buttons inside of it $(''radios'').observe(''click'', toggleForm); // Run the toggleForm function to set // the initial state of the form toggleForm(); }); </script> <form> <table> <tbody id=''radios''> <tr> <td><input type=''RADIO'' name=''option1'' value=''yes'' />Yes</td> <td><input type=''RADIO'' name=''option1'' value=''no'' />No</td> </tr> <tr> <td><input type=''RADIO'' name=''option2'' value=''yes'' />Yes</td> <td><input type=''RADIO'' name=''option2'' value=''no'' />No</td> </tr> <tr> <td><input type=''RADIO'' name=''option3'' value=''yes'' />Yes</td> <td><input type=''RADIO'' name=''option3'' value=''no'' />No</td> </tr> </tbody> </table> </form> <div id=''toShow''> The form to show goes here </div>> Such as pluck, any, and select..?Pluck is an iterator function that pulls a property from each value in an array: http://prototypejs.org/api/enumerable/pluck any is another iterator that returns whether or not any of the values in array return true: http://prototypejs.org/api/enumerable/any select is a Selector function. It returns an array of all the elements that match the css selector. In this case, it is limited to all descendants of "#radios": http://prototypejs.org/api/element/select> And Also Im not sure what the ? and colon are forThis is what is called a ternary operator. It is basically a short- hand if/else statement. More info about it can be found here: http://en.wikipedia.org/wiki/%3F: Feel free to post again if you have more problems. On Jan 30, 2:31 pm, kodiacat <kodia...-/E1597aS9LQAvxtiuMwx3w@public.gmane.org> wrote:> Thank you for the response. Oh my, I''m not sure I understand this. I > think that you are suggesting to place the radio buttons in a <tbody> > also. This is good idea, I had been trying to go about it for each > individual element...something like below... Which is probably a > horrible way to do it....which explains why I haven''t been able to > figure this out(*blush). Your approach seems like it is a much better > way, if I can just figure it out.. There seem to be several things > there that I haven''t used before... Such as pluck, any, and select..? > And Also Im not sure what the ? and colon are for.... I apologize if I > am not making much since, or if I ask a stupid question. My brain is a > bit fuzzy at the moment, and....I''m a newbie. > Thank you again. > ~Becca~ > > if (document.getElementsByName(''element1'').value == ''Yes'') > { > $(''form_B'').show();} > > else (document.getElementsByName(''element1'').value == ''No'') > { > $(''form_B'').hide(); > > } > } > > On Jan 30, 1:42 pm, Nycto <NyctoFi...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > I would probably tackle the problem like this: > > > <script type=''text/javascript''> > > > Event.observe(window, ''load'', function () { > > > function toggleForm () { > > $(''toShow'')[ $(''radios'').select(''input[type=radio] > > [value=yes]'').pluck(''checked'').any() ? ''show'' : ''hide'' ](); > > } > > $(''radios'').observe(''click'', toggleForm); > > toggleForm(); > > > }); > > > </script> > > <form> > > <table> > > <tbody id=''radios''> > > <tr> > > <td><input type=''RADIO'' name=''option1'' value=''yes'' />Yes</td> > > > <td><input type=''RADIO'' name=''option1'' value=''no'' />No</td> > > > </tr> > > <tr> > > <td><input type=''RADIO'' name=''option2'' value=''yes'' />Yes</td> > > > <td><input type=''RADIO'' name=''option2'' value=''no'' />No</td> > > > </tr> > > <tr> > > <td><input type=''RADIO'' name=''option3'' value=''yes'' />Yes</td> > > > <td><input type=''RADIO'' name=''option3'' value=''no'' />No</td> > > > </tr> > > </tbody> > > </table> > > </form> > > > On Jan 30, 8:08 am, kodiacat <kodia...-/E1597aS9LQAvxtiuMwx3w@public.gmane.org> wrote: > > > > I am not a Ruby user, but I was hoping that maybe you guys could help > > > me with the some Javascript. I am using Prototype and Scriptaculous. > > > First off this is what I am trying to do: I have a table based form > > > A that has 6 yes/no questions using radio buttons. I have put these > > > questions in a separate <tbody> because using a div doesn''t work for > > > tables. If a user selects yes to any of these questions I would like > > > for Form B to automatically appear below these questions. Sounds > > > simple, but I am having some trouble. > > > > Here''s is where I am at: > > > I added id''s to all of the radio buttons. > > > Then I created an external js file, and then am calling it at the end > > > of my page. > > > In this external js file I have the following: > > > > [ > > > <script type="text/javascript" language="javascript"> > > > > var checkConflict = function checkConflict(){ > > > $(''test'').toggle(); > > > > } > > > > Event.observe(window,''load'',function() > > > { > > > Event.observe(''element1'', ''click'', function(){ checkConflict(); > > > }); > > > Event.observe(''element2'', ''click'', function(){ checkConflict(); > > > }); > > > Event.observe(''element3'', ''click'', function(){ checkConflict(); > > > }); > > > Event.observe(''element4'', ''click'', function(){ checkConflict(); > > > }); > > > Event.observe(''element5'', ''click'', function(){ checkConflict(); > > > }); > > > Event.observe(''element6'', ''click'', function(){ checkConflict(); > > > }); > > > > }); > > > > </script> > > > ] > > > So far so good, this works to show the questions whenever they click > > > yes. However I have two problems: > > > > 1. One is in firefox 2.0.0.11 I am getting this error: > > > "Element referenced by ID/NAME in the global scope. Use W3C standard > > > document.getElementById() instead. undefined... > > > > 2. The second problem I have is that if they select yes a > > > second time it hides the questions. > > > > I seem to be having a logic problem. It has been suggested that I used > > > element.observe, element.toggle, and also bind. But I don''t really > > > know how to do this. > > > I have searched everywhere trying to find a relevant example, and so > > > far I have turned up nothing. > > > > So if anyone has any ideas or can help it would be greatly > > > appreciated. I apologize if this doesn''t make sense. Please let me > > > know if I have made a mistake somewhere, or if you need more info. I > > > would post a link for you, but I am working on a private server, so I > > > can''t do that, but if you need something clarified please let me > > > know. Thank you in advance. > > > ~Becca--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Walter Lee Davis
2008-Jan-31 01:47 UTC
Re: Prototype Element.toggle, bind, and Event.observe
<http://en.wikipedia.org/wiki/%3F:> (The link didn''t work properly in Mail, just showed a page about the history of the Question Mark) Great article. Needs some references according to Wikipedia, but a nice write-up! Walter On Jan 30, 2008, at 6:31 PM, Nycto wrote:> This is what is called a ternary operator. It is basically a short- > hand if/else statement. More info about it can be found here: > http://en.wikipedia.org/wiki/%3F:--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Thank you soo much!! I really appreciate you explaining it, and providing the test example. :) I took the example you provided as is, and placed it in a test file, and then tested it in safari 3.0.4, Firefox 2.0.0.11, Camino 1.5.1, and IE 6.0. 1. am using Prototype1.6.0.2. Everything works great, except for Safari..I am getting this in my javascript debug console: Syntaxerror: Parse error and then The file path for my prototype.js file and nothing happens when I click on the radio buttons. I did some searching for prototype bugs in safari on google, and I found the following: http://dev.rubyonrails.org/ticket/10123 I didn''t know if this was related, but just in case, I downloaded the test case, and tried tested it in my browser, and everything seemed to work as expected. Do you have any ideas about why it isn''t working in Safari? If there is a workaround, or another way I can do this if this is a bug? Thank you very much for all your help. I really appreciate it. ~Becca On Jan 30, 7:47 pm, Walter Lee Davis <wa...-HQgmohHLjDZWk0Htik3J/w@public.gmane.org> wrote:> <http://en.wikipedia.org/wiki/%3F:> > > (The link didn''t work properly in Mail, just showed a page about the > history of the Question Mark) > > Great article. Needs some references according to Wikipedia, but a > nice write-up! > > Walter > > On Jan 30, 2008, at 6:31 PM, Nycto wrote: > > > This is what is called a ternary operator. It is basically a short- > > hand if/else statement. More info about it can be found here: > >http://en.wikipedia.org/wiki/%3F:--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Alright... I have tested the script in FireFox, IE6, IE7, Opera, Konqueror and Safari. Safari and Konqueror both complained about the upper case "RADIO" type attributes. Once fixed, however, everything worked fine: <tbody id=''radios''> <tr> <td><input type=''radio'' name=''option1'' value=''yes'' />Yes</td> <td><input type=''radio'' name=''option1'' value=''no'' />No</td> </tr> <tr> <td><input type=''radio'' name=''option2'' value=''yes'' />Yes</td> <td><input type=''radio'' name=''option2'' value=''no'' />No</td> </tr> <tr> <td><input type=''radio'' name=''option3'' value=''yes'' />Yes</td> <td><input type=''radio'' name=''option3'' value=''no'' />No</td> </tr> </tbody> On Jan 31, 7:41 am, kodiacat <kodia...-/E1597aS9LQAvxtiuMwx3w@public.gmane.org> wrote:> Thank you soo much!! I really appreciate you explaining it, and > providing the test example. :) > I took the example you provided as is, and placed it in a test file, > and then tested it in safari 3.0.4, Firefox 2.0.0.11, Camino 1.5.1, > and IE 6.0. 1. am using Prototype1.6.0.2. Everything works great, > except for Safari..I am getting this in my javascript debug console: > Syntaxerror: Parse error > and then The file path for my prototype.js file > and nothing happens when I click on the radio buttons. I did some > searching for prototype bugs in safari on google, and I found the > following:http://dev.rubyonrails.org/ticket/10123 > I didn''t know if this was related, but just in case, I downloaded the > test case, and tried tested it in my browser, and everything seemed to > work as expected. > Do you have any ideas about why it isn''t working in Safari? If there > is a workaround, or another way I can do this if this is a bug? > Thank you very much for all your help. > I really appreciate it. > ~Becca > On Jan 30, 7:47 pm, Walter Lee Davis <wa...-HQgmohHLjDZWk0Htik3J/w@public.gmane.org> wrote: > > > <http://en.wikipedia.org/wiki/%3F:> > > > (The link didn''t work properly in Mail, just showed a page about the > > history of the Question Mark) > > > Great article. Needs some references according to Wikipedia, but a > > nice write-up! > > > Walter > > > On Jan 30, 2008, at 6:31 PM, Nycto wrote: > > > > This is what is called a ternary operator. It is basically a short- > > > hand if/else statement. More info about it can be found here: > > >http://en.wikipedia.org/wiki/%3F:--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
d''oh Thank you very very much. Your solution worked to fix the "bug" in Safari. I don''t think I would have gotten this without you. I''m so happy I could hug someone. ;) Thank you again for all your help. ~Becca On Jan 31, 11:21 am, Nycto <NyctoFi...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Alright... I have tested the script in FireFox, IE6, IE7, Opera, > Konqueror and Safari. Safari and Konqueror both complained about the > upper case "RADIO" type attributes. Once fixed, however, everything > worked fine: > > <tbody id=''radios''> > <tr> > <td><input type=''radio'' name=''option1'' value=''yes'' />Yes</td> > <td><input type=''radio'' name=''option1'' value=''no'' />No</td> > </tr> > <tr> > <td><input type=''radio'' name=''option2'' value=''yes'' />Yes</td> > <td><input type=''radio'' name=''option2'' value=''no'' />No</td> > </tr> > <tr> > <td><input type=''radio'' name=''option3'' value=''yes'' />Yes</td> > <td><input type=''radio'' name=''option3'' value=''no'' />No</td> > </tr> > </tbody> > > On Jan 31, 7:41 am, kodiacat <kodia...-/E1597aS9LQAvxtiuMwx3w@public.gmane.org> wrote: > > > Thank you soo much!! I really appreciate you explaining it, and > > providing the test example. :) > > I took the example you provided as is, and placed it in a test file, > > and then tested it in safari 3.0.4, Firefox 2.0.0.11, Camino 1.5.1, > > and IE 6.0. 1. am using Prototype1.6.0.2. Everything works great, > > except for Safari..I am getting this in my javascript debug console: > > Syntaxerror: Parse error > > and then The file path for my prototype.js file > > and nothing happens when I click on the radio buttons. I did some > > searching for prototype bugs in safari on google, and I found the > > following:http://dev.rubyonrails.org/ticket/10123 > > I didn''t know if this was related, but just in case, I downloaded the > > test case, and tried tested it in my browser, and everything seemed to > > work as expected. > > Do you have any ideas about why it isn''t working in Safari? If there > > is a workaround, or another way I can do this if this is a bug? > > Thank you very much for all your help. > > I really appreciate it. > > ~Becca > > On Jan 30, 7:47 pm, Walter Lee Davis <wa...-HQgmohHLjDZWk0Htik3J/w@public.gmane.org> wrote: > > > > <http://en.wikipedia.org/wiki/%3F:> > > > > (The link didn''t work properly in Mail, just showed a page about the > > > history of the Question Mark) > > > > Great article. Needs some references according to Wikipedia, but a > > > nice write-up! > > > > Walter > > > > On Jan 30, 2008, at 6:31 PM, Nycto wrote: > > > > > This is what is called a ternary operator. It is basically a short- > > > > hand if/else statement. More info about it can be found here: > > > >http://en.wikipedia.org/wiki/%3F:--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---