Jason Hummel wrote:
> /* ***************** */
> fields = new Array();
> fields[pFieldName] = new Field(pFieldName, name);
> /* ***************** */
> 
> Later on when it's validating this field it does something like this:
> 
> /* ***************** */
> for(var currentField in fields) {
>       if(!fields[currentField].validate()) {
>           isValid = false;
>        }
> }
> /* ***************** */
> 
> Any ideas how I can get these scripts to play nice?

var isValid = true;
if (window.Prototype) {
  fields.each(function(value, index) {
    if (!value.validate())
      isValid = false;
  });
} else {
  for (var currentField in fields) {
    if (!fields[currentField].validate())
      isValid = false;
  }
}

... or, something to that affect.

Todd

-- 
Posted via http://www.ruby-forum.com/.
_______________________________________________
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs

Reply via email to