1
alert($("select[name="+"this.name"+"] option:selected").text());

but nothing is being returned unless I give the name of the combobox instead of calling this.name, I might be having problems with the quotes.

1 Answers1

0

Use $(this) to get the text of selected option of changed selectbox:

$(this).find("option:selected").text();
Dhara Parmar
  • 8,021
  • 1
  • 16
  • 27
  • Oh God that worked thanks very much :) – Bruno Filgueiras Jun 03 '16 at 13:47
  • Dhara's answer is correct and your code is not working because your adding strings to strings in selector area "select[name="+"this.name"+"] option:selected" this code vill give you "select[name=this.name] option:selected" as string. But you are trying to add some dynamic content in it so it should be like "select[name='"+this.name+"'] option:selected" – Güven Altuntaş Jun 03 '16 at 13:48