I have a simple dropdown and want to get the specific value of an option if the user changes the dropdown selection, but without having him to push a submit button. Is this poss
its very simple.. try this
$('#BezirksAuswahl').change(function(){
var selected_value = $(this).val();
});
Check your JQuery include, you must not be including Jquery correctly. What version are you referencing?
Ensure you are running your script when JQuery is loaded:
$(document).ready(function () {
$('#BezirksAuswahl').change(function(e){
alert(this.value);
});
});
$('#BezirksAuswahl').change(function(){
alert($(this).val());
});
Use the change
event, which fires when the value of the element changes, like so:
$('#BezirksAuswahl').change(function(e){
alert(this.value);
});