I want to use the javascript variable in php. When a select option is selected from dropdown it triggers change function and its value is obtained.i want to use this value in php to check the database.
Below is the code:
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script type="application/javascript">
$(document).ready(function(){$('select[name="dropdown"]').change(function(){
var a=$(this).val() ;
alert(a);
});
});
</script>
</head>
<body>
<select name="dropdown" size=1>
<option value="1">option 1</option>
<option value="2">option 2</option>
</select>
</html>
</body>
If Aneyone could help?