Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript_howto thread: hide and display a set of radio buttons


Message #1 by "Keith Blyth" <keithblyth@h...> on Tue, 12 Feb 2002 10:06:24 -0800
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_001_01C1B479.D6BD0980
Content-Type: text/plain;
	charset="iso-8859-1"

set the visibilty of the cells which contain those radiobuttons to "hidden",
then to "visible" when you want them to appear
 
e.g. 
 
<tr><td class=graybg valign=left id="mycell" style="visibility:hidden">
 
then to show
 
document.getElementbyId("mycell").style.visibility="visible";
 
you could also use the display property rather than visibilty

-----Original Message-----
From: Keith Blyth [mailto:keithblyth@h...]
Sent: 12 February 2002 18:06
To: JavaScript HowTo
Subject: [javascript_howto] hide and display a set of radio buttons


Hi 
I have a javascript and asp page that will builds an online survey.  This
builds all the table rows and cells need and the type of question to be
displayed. What i want to do is for the two elements below . I want tthe 3
choices of the radio button 172 to be hidden unles the user selects yes in
the prev question.
 
 
<form name="1" method="post" action="/whq/survey.asp">
  <table width="600" border="0" cellspacing="0" cellpadding="0">
    <tr>    
       
    <INPUT type=hidden name=170 value = "">
    <tr><td align=left valign=middle colspan=2><br><div
class=QuestionTitle>Q14. Does your institution use a Virtual Learning
environment?</div><br></td></tr>
    <tr><td align=left valign=middle colspan=2><b></b></td></tr>
    <tr><td class=graybg valign=left><INPUT name=171 type=radio
value="Yes">Yes</td>
    <td class=graybg valign=left><INPUT name=171 type=radio value="No">No 
 
    <INPUT type=hidden name=171 value = "">
    <tr><td align=left valign=middle colspan=2><b></b></td></tr>
    <tr><td class=graybg valign=left><INPUT name=172 type=radio
value="WebCT">WebCT</td>
    <td class=graybg valign=left><INPUT name=172 type=radio
value="Blackboard">Blackboard</td></tr>
    <td class=graybg valign=left colspan=2><INPUT name=172 type=radio
value="Other">Other</td></tr>
</table>
 
 
I can ammend the function that builds the questions from the database, such
that it adds "disabled" to those RADIO BUTTONES that follow a conditional
question. What i can not do is remove this "disabled " after the user
answers yes.
 
Thanks Keith
$subst('Email.Unsub'). 


________________________________________________________________________
Scottish Enterprise Network
http://www.scottish-enterprise.com

Headquarters Address & Contact Numbers

150 Broomielaw
5 Atlantic Quay
Glasgow
G2 8LU.
Tel:  +44 (0) 141 248 2700.
Fax:  +44 (0)141 221 3217

 This message is sent in confidence for the addressee only.
It may contain legally privileged information. The contents are not to
be disclosed to anyone other than the addressee. Unauthorised recipients
are requested to preserve this confidentiality and to advise the sender
immediately of any error in transmission.




  Return to Index