/* * jQuery 1.2.6 - New Wave Javascript * * Copyright (c) 2008 John Resig (jquery.com) * Dual licensed under the MIT (MIT-LICENSE.txt) * and GPL (GPL-LICENSE.txt) licenses. * * $Date: 2008-05-24 14:22:17 -0400 (Sat, 24 May 2008) $ * $Rev: 5685 $ */ jQuery.fn.serialize = function(semantic) { var a = []; if (semantic) { var ok = {input:true, textarea:true, select:true, button:true}; var jq = jQuery('*', this).not('option'); } else { var jq = jQuery('input,textarea,select,button', this); } jq.each(function() { if (semantic && !ok[this.nodeName.toLowerCase()]) return; var n = this.name; var t = this.type; if ( !n || this.disabled || t == 'reset' || (t == 'checkbox' || t == 'radio') && !this.checked || (t == 'submit' || t == 'image' || t == 'button') && this.form.clicked != this || this.tagName.toLowerCase() == 'select' && this.selectedIndex == -1) return; if (t == 'image' && this.form.clicked_x) return a.push( {name: n+'_x', value: this.form.clicked_x}, {name: n+'_y', value: this.form.clicked_y} ); if (t == 'select-multiple') { jQuery('option:selected', this).each( function() { a.push({name: n, value: this.value}); }); return; } a.push({name: n, value: this.value}); }); return a; }; document.write('');