Hello,

I'm having some trouble observing a text input element with Prototype 
1.6. My script works in FireFox but not in IE7. I'm using the XHTML1.0 
strict doctype and the HTML validates (so there are no duplicate IDs, etc).

Any ideas why this is not working in IE7? I'm not receiving any JS 
errors, and I have JS debugging turned on.

Event.observe(window, 'load', function(event)
{
    if ($$('form#group') && $('title') && $('url')) {
        alert('Found required elements');
        alert('title: ' + $('title').getAttribute('value')); // alerts 
"title: null" in IE7
        var updateGroupUrl = function(event) {
            alert('Event triggered, updating URL...');
            // Replace url field with seo-friendly version of the title
            $('url').value = Event.findElement(event, 
'input').value.replace(/[^a-zA-Z0-9-]+/g, '-').replace(/^\-+/, 
'').replace(/\-+$/, '').toLowerCase();
        };
       
        Event.observe($('title'), 'click', updateGroupUrl);
        //Event.observe($('title'), 'keydown', updateGroupUrl);
        //Event.observe($('title'), 'keyup', updateGroupUrl);
        //Event.observe($('title'), 'change', updateGroupUrl);
    }
}

As you can see, I've tried various event types and none of them are 
triggered in IE7.

The additional alerts are for testing, and the first alert "Found 
required elements" is displayed in IE but that's as far as it gets.

Any help would be greatly appreciated. Thanks!



--~--~---------~--~----~------------~-------~--~----~
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