Skip to content

Commit

Permalink
Add Biocollect waterwatchSA custom js script
Browse files Browse the repository at this point in the history
  • Loading branch information
yasima-csiro committed Apr 4, 2022
1 parent 025405c commit a5e06f3
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions scripts/models/WaterwatchSA/setSiteName.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
self.data.siteCode = ko.observable().extend({metadata:{metadata:self.dataModel['siteCode'], context:self.$context, config:config}});
self.data.location.subscribe(function (obj) {
var siteName = $('#siteLocation').find(":selected").text().trim();
if(obj && siteName != 'Select a location'){
self.data.siteCode(siteName);
}
else if(siteName == 'Select a location'){
self.data.siteCode("");
}
});

0 comments on commit a5e06f3

Please sign in to comment.