/* * jqFunc 0.1 - jQuery Extended Functions * * Copyright (c) 2007 Vladimir Romanovich (ibnteo@gmail.com) * License: GPL2 */ jQuery.fn.fieldValue = function(successful) { var result = ""; if(this[0].tagName.toLowerCase() == "select") { this.children().each(function(i) { if(this.selected) result += $(this).val() + ","; }); (result = result.split(",")).pop(); } else { if(this.attr("type") && (this.attr("type").toLowerCase() == "checkbox" || this.attr("type").toLowerCase() == "radio")) { this.each(function() { if(this.checked) result += this.value + ","; }); (result = result.split(",")).pop(); } else { result = this.val(); } } return result; };