SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot
    Join Date
    Dec 2004
    Location
    Telford, UK.
    Posts
    149
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Showing items only when a tickbox is ticked

    I have a really basic form entry page in html as follows.
    HTML Code:
    <html>
    
    <head>
    <title>Job Details</title>
    <meta http-equiv="Page-Enter" content="blendTrans(Duration=1.0)">
    </head>
    
    <body bgcolor="#F6F7EB" topmargin="2" leftmargin="1">
    
    <form action="enter_job2.php" Method=post>
    
    <p align="center"><font face="Tahoma" size="5"><?php echo $_SESSION['firstname'] . " " . $_SESSION['lastname']; ?> </p> 
    <p align="center"><font face="Tahoma" size="4">Enter Case Review Details.</font></p>
    <div align="right">
      <table border="3" width="100%" height="1" cellspacing="6" cellpadding="4">
        <tr>
          <td width="100%" height="1" valign="top" align="left">
            <p align="left"><font face="Tahoma"><b><u>Job Details</u></b></font></p>
            <p><font face="Tahoma">Date:<input type="text" name="date" size="20"></font></p>
            <p><font face="Tahoma">PRF Number: <input type="text" name="prf" size="20"></font></p>
            <p>Manager/Officer Reviewed? <input type="checkbox" name="C2" value="ON"></p>
            </td>
        </tr>
        <tr>
          <td width="100%" height="1" valign="top" align="left">
            Part One - Clinical / Case Review<p>Examination And Patient Assessment</p>
            <p><textarea rows="5" name="S1" cols="100"></textarea></font></p>
            <p>&nbsp;</p>
            <p>Chief Complaint</p>
            <p><textarea rows="3" name="S2" cols="100"></textarea><p>&nbsp;<p>
            Treatment<p><textarea rows="5" name="S3" cols="100"></textarea><p>&nbsp;<p>
            JRCALC Guidelines Followed? <input type="checkbox" name="C1" value="ON"> <p>
            (If not reasons given...)<p><textarea rows="3" name="S4" cols="100"></textarea><p>&nbsp;<p>
            Handover (Comments)<p><textarea rows="2" name="S5" cols="100"></textarea><p>&nbsp;</td>
        </tr>
        <tr>
          <td width="100%" height="46" valign="top" align="center">
            <p align="left">&nbsp;</p>
    
            </td>
    
        </tr>
      </table>
    </div>
    <p align="center"><input type="submit" value="Submit" name="B1"></p>
    </body>
    
    </html>
    What I want to know though is it possible to display the last text box only if the tick box is ticked - otherwise it is not shown? If it is possible how on earth do I do it?

    I originally posted this on the PHP section and someone suggested I would have to head Javascript. I have no experience with Javascript at all.
    Is it possible to do this and if it is what is involved??

  2. #2
    SitePoint Zealot
    Join Date
    Jun 2006
    Location
    London, UK
    Posts
    154
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What checkbox are you refering to, it is possible but I need to know which one first

  3. #3
    SitePoint Zealot
    Join Date
    Dec 2004
    Location
    Telford, UK.
    Posts
    149
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It's this check box that if it's ticked...

    HTML Code:
    <p>Manager/Officer Reviewed? <input type="checkbox" name="C2" value="ON"></p>
    will show this text box
    HTML Code:
    <p>Handover (Comments)<p><textarea rows="2" name="S5" cols="100"></textarea><p>


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •