document.getElementById(...) is being called before eqvalue.replace(...) (remember, in f(..., g(...), ...), the call to g(...) must be evaluated before f is called). The solution is to use an anonymous function:
Code:
var editedExpression = eqvalue.replace(/\{(.+?)\}/g,
function(matched, id) { return document.getElementById(id).value; });
The matched substrings are passed as parameters to the function; $& is passed in arguments[0] and $n in arguments[n].
Also note that the $n signifier for positional parameters is only supported in a few contexts: a regular expression and a plain string replacement. There are also properties of RegExp named $n that hold the matches from the last successful match; while they have the same signifiers, they're different beasts. "$n" has no special meaning within a function replacement.