Reputation: 309
I have three select boxes, one to select the year, another one for the month and the last one for the day. My goal is to have them automatically inserted into one hidden field (resulting in e.g. 2012-07-16) which is the main "date" field and that get's stored into the database.
Does anyone have an idea how this can be best achieved? Some advise would be highly appreciated, thank you very much, Patrick
Upvotes: 0
Views: 115
Reputation: 16107
$('#year, #month, #day').change(function() {
$('#date').val($('#year').val()+'-'+$('#month').val()+'-'+$('#ay').val())
});
Upvotes: 2