I have tried:
...
<script type="text/javascript">
var myVar = "some string";
</script>
...
<input name="&{myVar};" ... />
...
But using FireFox the name is set to the literal string: "&{myVar};" instead of the value of myVar...
UDPATE: I see this called JavaScript Entities and hasnt been supported for a long time - but there must be way if one can include JavaScript directly in events (I realise attributes are not events so JavaScript probably isnt looked for).. ?! It would be a lot nicer than hardcodeing the value as it used elsewehere a lot..