[javascript] How do you write strings to the middle of a web page?
I'm trying to have users enter info into a form (via radio buttons), manipulate the input data, and write resulting text onto the middle of a web page--beneath the radio buttoned form. So I have variables assigned to whenever a user selects a radio button, something like:

<code>
function saveValue1(value) {<br>
aVariable=value;<br>
}
</code>

And when users click a Submit button, a function works like it's supposed to, ultimately writing an output string. The problem is how to write the string value in the middle of the page. I have this [pseudo]code at the end of the function (pretend the string I want to write to the page is named aVariable):

<code>
document.getElementById('aPlace').innerHTML=aVariable;
</code>

And of course there's HTML in the displayed page like this:

<code>
<div id="aPlace"></div>
</code>

After a user pressed the form's Submit button the correct output variable is displayed very briefly, and then disappears. Why is this? And how should I be writing this code instead?

Thanks for helping a newbie, as always.


[javascript] How do you write strings to the middle of a web page?
===

I'm trying to have users enter info into a form (via radio buttons), manipulate the input data, and write resulting text onto the middle of a web page--beneath the radio buttoned form. So I have variables assigned to whenever a user selects a radio button, something like:

<code>
function saveValue1(value) {<br>
aVariable=value;<br>
}
</code>

And when users click a Submit button, a function works like it's supposed to, ultimately writing an output string. The problem is how to write the string value in the middle of the page. I have this [pseudo]code at the end of the function (pretend the string I want to write to the page is named aVariable):

<code>
document.getElementById('aPlace').innerHTML=aVariable;
</code>

And of course there's HTML in the displayed page like this:

<code>
<div id="aPlace"></div>
</code>

After a user pressed the form's Submit button the correct output variable is displayed very briefly, and then disappears. Why is this? And how should I be writing this code instead?

Thanks for helping a newbie, as always.

