You have to make some correction in your function..
function check()
{
var dist = document.getElementById('value').value; //for input text value
if (dist!==""){ // for comparision
window.location.href="district.php?dist="+dist;
}
else
alert('Oops.!!');
}