paulo@explicadores.net
2006-Feb-14 13:34 UTC
[Rails] Firefox java script error in prototype.js
Hi, I am usign two selects, a master and a slave: <%= select("master", "id", @master) %> <div id="slave_id_list"> <%= select("slave", "id", @slave) %> </div> <%= observe_field("master[id]", :frequency => 0.25, :update => "slave_id_list", :url => {:action => :update_slave_select}, :with => "''my_id=''+value") %> also I made: def index @master = ... @slave= ... end def update_slave_select @slave= .... render(:partial => ''select'') end and in _select.rhtml: <%= select("slave", "id", @slave) %> This works fine in internet explorer, in firefox I have the following javascript error: Error: element has no properties Source File: http://localhost:3000/javascripts/prototype.js Line: 1280 and the javascript code at prototype: Form.Element = { serialize: function(element) { element = $(element); var method = element.tagName.toLowerCase(); var parameter = Form.Element.Serializers[method](element); if (parameter) { var key = encodeURIComponent(parameter[0]); if (key.length == 0) return; if (parameter[1].constructor != Array) parameter[1] = [parameter[1]]; return parameter[1].map(function(value) { return key + ''='' + encodeURIComponent(value); }).join(''&''); } }, getValue: function(element) { element = $(element);>>>>>>>>>> var method = element.tagName.toLowerCase();var parameter = Form.Element.Serializers[method](element); if (parameter) return parameter[1]; } } Any sugestion for solving this? Thanks, Paulo Abreu
Mark Reginald James
2006-Feb-14 19:37 UTC
[Rails] Re: Firefox java script error in prototype.js
paulo@explicadores.net wrote:> <%= observe_field("master[id]", > ... > This works fine in internet explorer, in firefox I have the following javascript > error: > ... > Error: element has no propertiesTry <%= observe_field("master_id", -- We develop, watch us RoR, in numbers too big to ignore.