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 <[EMAIL PROTECTED]> 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 <[EMAIL PROTECTED]> 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 <[EMAIL PROTECTED]> 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 [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to