jqFunc jQuery Extended Functions Copyright 2007 Vladimir Romanovich ib

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/*
* 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;
};