Hi, Dunno if this is just a typo in your mail, but document.main.[name].value won''t work anyway, you''d need document.main[name].value i.e. no dot before the bracket. Prototype doesn''t do anything to affect the syntax of the core language, nor could any piece of Javascript, as far as I''m aware. HTH, Dave On Thursday 21 June 2007 16:36, sed wrote:> Does anyone have any info on using prototype, but also having script > with bracket notation? > > like document.main.[name].value. This seems to no longer work with > prototype included. > > >-- Author: Prototype & Scriptaculous in Action, Ajax in Practice, Ajax in Action --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Does anyone have any info on using prototype, but also having script with bracket notation? like document.main.[name].value. This seems to no longer work with prototype included. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
There''s a mistake in the above example, maybe that''s where your issue comes from. Try: document.main[name].value // i.e. remove the fot before [ On Jun 21, 11:36 am, sed <s...-BZZWBWMTKgv1P9xLtpHBDw@public.gmane.org> wrote:> Does anyone have any info on using prototype, but also having script > with bracket notation? > > like document.main.[name].value. This seems to no longer work with > prototype included.--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Your right about the typo above, but it''s not like that in my code, yet it breaks with prototype and not without. I am also finding problems like, $(Name).focus(), where Name is a variable and the field Name is an input field in a form, error is object doesn''t support property or method. I"m not sure what''s going on with both these, I can do $(Name).value and it works, but $(Name).focus() breaks, it''s just input type text field??? On Jun 21, 12:31 pm, tobie <tobie.lan...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> There''s a mistake in the above example, maybe that''s where your issue > comes from. > > Try: document.main[name].value // i.e. remove the fot before [ > > On Jun 21, 11:36 am, sed <s...-BZZWBWMTKgv1P9xLtpHBDw@public.gmane.org> wrote: > > > > > Does anyone have any info on using prototype, but also having script > > with bracket notation? > > > like document.main.[name].value. This seems to no longer work with > > prototype included.- Hide quoted text - > > - Show quoted text ---~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Interesting problem here and I don''t think it''s a prototype bug, but I corrected the issue. Here is what was happening if anyone''s interested Here is a short explanation: Ajax Call generates some html into a div with this function inside: GetNextField = function() {return(''thenextfield'');}; In an included .js file there is another function that goes like so: function NextField() { FieldName = new String(GetNextField()); // then doing so breaks $(FieldName).focus() or document.main[FieldName].focus(); } It''s the ''new String'' that''s breaking it, but prior to adding prototype and dumping all this into a layer with ajax it worked just fine The fix: FieldName = GetNextField(); Bracket and prototype notation both work. I''m not sure why this worked before, it must be related to the html/ script being generated into the div from the ajax.updater rather than just being on the page. Not a prototype issue. On Jun 21, 1:33 pm, sed <s...-BZZWBWMTKgv1P9xLtpHBDw@public.gmane.org> wrote:> Your right about the typo above, but it''s not like that in my code, > yet it breaks with prototype and not without. I am also finding > problems like, $(Name).focus(), where Name is a variable and the field > Name is an input field in a form, error is object doesn''t support > property or method. I"m not sure what''s going on with both these, I > can do $(Name).value and it works, but $(Name).focus() breaks, it''s > just input type text field??? > > On Jun 21, 12:31 pm, tobie <tobie.lan...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > There''s a mistake in the above example, maybe that''s where your issue > > comes from. > > > Try: document.main[name].value // i.e. remove the fot before [ > > > On Jun 21, 11:36 am, sed <s...-BZZWBWMTKgv1P9xLtpHBDw@public.gmane.org> wrote: > > > > Does anyone have any info on using prototype, but also having script > > > with bracket notation? > > > > like document.main.[name].value. This seems to no longer work with > > > prototype included.- Hide quoted text - > > > - Show quoted text -- Hide quoted text - > > - Show quoted text ---~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---