Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function trueRefreshSelects(sels, vals) {var names = []; sels.each(function(){
- var $this = $(this);
- var prev = $this.prev();
- if (!$this.attr('name')) return undefined;
- if (!prev.hasClass('selectArea')) return undefined;
- var m = prev.attr('id').match(/\d+$/); if (m.length === 0) return undefined;
- var index = m[0];
- prev.remove();
- var b, d;
- do { d = document.getElementById("optionsDiv"+5); b = d != null; if (d) d.parentNode.removeChild(d); } while (b);
- var i, str = ''; for (i in vals) { if (!vals.hasOwnProperty(i)) continue; str+= '<option value="{index}">{value}</option>'.replace('{index}', i).replace('{value}', vals[i]) }
- $(str).appendTo($this);
- });
- refreshSelects(names);
- }
Advertisement
Add Comment
Please, Sign In to add comment