Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

document.writeln ? 1

Status
Not open for further replies.

Ovatvvon

Programmer
Feb 1, 2001
1,514
US
Hey, I have a relativly simple task that I can't seem to remember...

I have 3 radio buttons that give a user 3 different choices. When they select choice one, I want it to print a line saying something like, choose your favorite kind of [choice 1]... same goes for choice 2 or choice 3. I want it to enter the text line dynamically based on which choice they selected, and it can change constantly as they click on different options.

However, when I use the write or writeln method, it clears the page and writes the value as the only thing on the page. I want it to write that text in a specific area on the page.

How can I do this?
-Ovatvvon :-Q
 
<script>
function placeText(inVal){
document.all[&quot;desc&quot;].innerHTML = inVal
}
</script>

<input type=radio name=radio1 value=&quot;cookie&quot; onClick=&quot;placeText(this.value)&quot;>
<input type=radio name=radio1 value=&quot;ice cream&quot; onClick=&quot;placeText(this.value)&quot;>
<input type=radio name=radio1 value=&quot;cake&quot; onClick=&quot;placeText(this.value)&quot;>

<br><br>
Choose your favorite kind of <span id=&quot;desc&quot;>dessert.</span> Get the Best Answers! faq333-2924
Merry Christmas!
mikewolf@tst-us.com
[angel][santa][elf][reindeer][santa2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top