codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  Q&A radiobuttons to generate a response?  Orbital at 14:11 on Tuesday, September 28, 2004
 

OK straight off the bat, what I'm trying to do on a webpage I'm making is to have 3 pairs of radio-buttons (Yes and No answers to three questions) and when the visitor has made a selection for all three pairs, an answer appears below.

This should be simple because it's only the [u]one[/u] answer - "If you answered yes to all three questions then..."

I'm thinking I could make the answer text white - as that's the background colour, and have it change to black when there's been a selection made for each pair of radio-buttons - I just have no idea how to code that into html!

I'd be greatly appreciative if anybody could show me how this could be done.

  Re: Q&A radiobuttons to generate a response?  Troy Wolf at 14:53 on Monday, October 04, 2004
 

Here is one way:
<script language=javascript>
function InsertContent() {
document.getElementById("mydiv").innerHTML = "This is the text I want to display.";
}
</script>
<a href="javascript:InsertContent();">do it</a>
<p>
<div id="mydiv"></div>

Here is another:
<script language=javascript>
function InsertContent() {
x = document.getElementById("mydiv");
x.style.display = "inline";
}
</script>
<a href="javascript:InsertContent();">do it</a>
<p>
<div id="mydiv" style="display:none;">This is the text I want to display.</div>

I just typed this into this reply--I did not test it, and since I average 2 errors per line of code, don't be surprised to fine a problem!

Troy Wolf: site expert
SnippetEdit Website Editor









CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums
//








Recent Forum Threads
•  Re: Problem with concatenation
•  how to genrates the crystal report by sending a id at runtime
•  help me
•  pls help me with this..
•  Re: Security - Code verify
•  Job @ EarlySail
•  Job @ EarlySail (perl)
•  IPC problem
•  Re: import contacts of msn/yahoo


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


© Copyright codetoad.com 2001-2007