function AutoSubmit() { var field; var form; } AutoSubmit.prototype = { setField:function(field) { this.field = field; }, setForm:function(form) { this.form = form; }, init:function() { if (this.field == null) return; switch(this.field.tagName.toLowerCase()){ case "select": this.field.onchange = this.scope(this.handleChange);break; default: this.field.onclick = this.scope(this.handleChange);break; } }, handleChange:function(e) { if (this.form == null) return; this.form.submit(); }, scope:function(method) { var scope = this; return function() { return method.apply(scope, arguments); } } } function autosubmit(){ var objform; var el; var els; if(document.forms!=null && document.forms.length>0){ for (var i=0;i