How to pass this variable value here? Below code is not working. And all other discussions on Stackoverflow are unclear.
<script type="text/javascript">
        function check()
        {
            var dist = document.getElementById('value');
            if (dist!=""){
                window.location.href="district.php?dist="+dist;
            }
            else
               alert('Oops.!!');
        }
</script>
And my HTML code is:
<select id="value" name="dist" onchange="return check()">
				
                        
You have to fetch field value using
.valueas you are passing whole object to the URL asdocument.getElementbyId('value')returns whole field object.So your function should be like this