Ну, не знаю, у меня работает:
<!DOCTYPE HTML>
<html>
<head>
<title>qwerty</title>
<meta HTTP-EQUIV=Content-Type CONTENT="text/html; CHARSET=UTF-8">
</head>
<body>
<script>
function qwerty ()
{
var field = document.getElementById("fieldName");
alert(field.value);
return;
}
</script>
<form>
<input type="text" name="fieldName" id="fieldName" >
<input type="button" onclick="qwerty(fieldName.value)" value="Вывод" >
</form>
</body>
</html>