I use a 'change'-function to put the value of selectbox into an input
$("#afa_select").change(function() {
var nd_value = $('#afa_select :selected').text();
$("#nd_hidden").val(nd_value);
});
The options of the selectbox contain the following strings:
text 10 Jahre
another text 6 Jahre
just another text 12 Jahre
another text with a figure e.g. 1000 6 Jahre
another text with a figure e.g. 3234 6 Jahre
I need to find the number in front of the string " Jahre" and put this value into the input #nd_hidden.