-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmyfun.js
More file actions
53 lines (44 loc) · 1.55 KB
/
myfun.js
File metadata and controls
53 lines (44 loc) · 1.55 KB
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
function currval(){
var values = $(':input').map(function() {
if ((this.id !="")||(this.id =="userDropdown")){ return $(this).val() ; }
}).get();
return values;
}
function numcurrval(){
var values = $(':input[type=number]').map(function() {
if ((this.id !="")||(this.id =="userDropdown")){ return $(this).val() ; }
}).get();
return values;
}
function shajax(url , data,oput){
$.ajax({url: url,data: data , type: "POST", success: function(json) {$("#"+oput).html(json) ; } });
}
function currvalpid(){
var values = $(':input').map(function() {
if ((this.id !="")||(this.id =="userDropdown")){ return this.id +":"+ $(this).val() ; }
}).get();
return values;
}
function curnumvalpid(){
var values = $(':input[type=number]').map(function() {
if ((this.id !="")||(this.id =="userDropdown")){ return this.id +":"+ $(this).val() ; }
}).get();
return values;
}
function selectradio(){
var values = $(':input[type=radio]').map(function() {
if (this.selected ==true) { return $(this).val() ; }
}).get();
return values;
}
function caldf(codeval){
var icode=codeval.substr(1);
var s1=($("#s"+icode).val()=="")?0:parseFloat($("#s"+icode).val());
var m1=($("#m"+icode).val()=="")?0:parseFloat($("#m"+icode).val());
var l1=($("#l"+icode).val()=="")?0:parseFloat($("#l"+icode).val());
var x1=($("#x"+icode).val()=="")?0:parseFloat($("#x"+icode).val());
//var amt =parseFloat($("#c"+icode).val()) * parseFloat($("#q"+icode).val());
var bal=parseFloat($("#t"+icode).val())-( s1 + m1 + l1 +x1 );
$("#d"+icode).val(bal);
return 0;
}