I'd like to compute a value and carry that computation in the form post, so what I do is:
<form>
<input name="myID" id="myID" type="hidden" />
</form>
$('#myID').attr('value',myCalculation);
What I would like to do is display it as well, so I've added:
<div id="myIDdisplay"></div>
$('#myIDdisplay').text(myCalculation);
Is there a better, more elegant way than duplicating the assignment of myCalculation to both the hidden form field and the displayed area?
I don't want the user to get confused in thinking that it's an input field, so I'd rather not display the input tag. And I just can't trust CSS enough to think that CSS will remove the input border on every version of every browser.