split_values1 is an array and it contents some values, all i want to do is add those values to the textfield with a , separating them.
for(var i = 0; i < split_values1.length; i++) {
$('#teach_subjects').value += split_values1[i]", ";
}
Use join on your array and val to set textfield value:
$('#teach_subjects').val(split_values1.join(', '));
Since you are using jQuery I would do this.
var val = $('#teach_subjects').val();
for(var i = 0; i < split_values1.length; i++) {
val += split_values1[i] + ", ";
}
$('#teach_subjects').val(val);
It's a bad idea for performance reasons to constantly update a value in the DOM, so I used string concatenation.
As others have stated join might be a better choice.
&? jQuery objects don't have avalueproperty. jQuery's documentation os quite good, it's the first thing you should have a look at: api.jquery.com