Created
January 8, 2013 17:47
-
-
Save sampottinger/4485999 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function retrieveUserInput() | |
{ | |
var output = new Object(); | |
output.heifer = { type: "heifer", grazing: {}, nongrazing: {} }; | |
output.bred_heifer = { type: "bred_heifer", grazing: {}, nongrazing: {} }; | |
output.springer = { type: "springer", grazing: {}, nongrazing: {} }; | |
output.first_calf_heifer = { type: "first_calf_heifer", grazing: {}, nongrazing: {} }; | |
output.dry = { type: "dry", grazing: {}, nongrazing: {} }; | |
output.lactating = { type: "lactating", grazing: {}, nongrazing: {} }; | |
$('.tab-pane').find('.feed-in-num').children().each(function(i) { | |
var active_tab = $(this).parents('.tab-pane').attr('id').split('_')[0]; | |
var feed_id = $(this).attr('id').split('-'); | |
var feed_val = $(this).attr('value'); | |
var new_feed = 'feed_' + i | |
output.getAttribute(activeTab)[feed_id[1]][new_feed] = { name: feed_id[2], val: feed_val }; | |
}); | |
return output; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment