Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    May 2011
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Hide/Show Table plus reset button

    Hi,

    I need a button that not only resets what is typed in the textarea but also hides all shown tables...

    Here's how my current set up is...

    ---------text area------ with a reset button

    table1 title (when clicked, shows a table under it)
    table2 title (when clicked, shows a table under it)
    table3 title (when clicked, shows a table under it)

    the tables under the main tables have buttons that when clicked on inserts texts in the textarea.

    Any help would be much much appreciated!

  • #2
    Senior Coder DanInMa's Avatar
    Join Date
    Nov 2010
    Location
    Salem,Ma
    Posts
    1,577
    Thanks
    13
    Thanked 248 Times in 248 Posts
    show your code!

  • #3
    New to the CF scene
    Join Date
    May 2011
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    im still working on it but here's my draft so far...

    (how does one paste codes here.... lemme try this....)

    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
        "http://www.w3.org/TR/html4/loose.dtd">
     
    <html>
     
    <head>
      <title></title>
    </head>
     
    <body>
    <SCRIPT LANGUAGE="JavaScript"> 
    // Row Hide function.
    // by tcadieux
     
    function expandcontract(tbodyid,ClickIcon) {
    if (document.getElementById(ClickIcon).innerHTML == "+"){
    document.getElementById(tbodyid).style.display = "";
    document.getElementById(ClickIcon).innerHTML = "-";
    } else {
    document.getElementById(tbodyid).style.display = "none";
    document.getElementById(ClickIcon).innerHTML = "+";
    }}
     
     
     
    <!--
    var body=0;
    linkvar = 0;
    function prompt2(String , msg, tags, tags2) {
    String=prompt(msg, "");
    if (String != "" || null) {document.Form1.none.value=document.Form1.none.value + tags + String + tags2 + '\r'
    }
    }
     
    function end() {
    if (body == 0) { addtag('</HTML>') }
    else { addtag('</BODY></HTML>') }
    }
     
    function addtag(tag) {
    document.Form1.none.value=document.Form1.none.value + tag + '\r'
    }
    //-->
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
    </SCRIPT>
     
     
     
     
     
     
    <FORM name=Form1>
    	<table width="500"><td align="right">
    		<input type="reset" value="CLEAR NOTES">
    	</td>
    	</table>
     
     
     
    	<TEXTAREA Name=none COLS="60" ROWS="10"></TEXTAREA>
     
     
     
     
     
     
     
     
     
     
    <table border=0>
     
    	<tr>
    		<td onclick="expandcontract('Row1','ClickIcon1')" id="ClickIcon1" style="cursor: pointer; cursor: hand;">+</td>
    		<td>table1</td>
    	</tr>
     
    		<tbody id="Row1" style="display:none">
    		<tr>
    			<td colspan="2"><INPUT TYPE=button name=none3 value="w1aaat UN/PW" onclick="end('</BODY></HTML>')"></td>
    			<td colspan="2"><INPUT TYPE=button name=none3 value="wa2aat UN/PW" onclick="end('</BODY></HTML>')"></td>
    		</tr>
    		<tr>
     
    			<td colspan="2"><INPUT TYPE=button name=none3 value="wat UN/PW" onclick="end('</BODY></HTML>')"></td>	
    			<td colspan="2"><INPUT TYPE=button name=none3 value="wa2aat UN/PW" onclick="end('</BODY></HTML>')"></td>
    			<td colspan="2"><INPUT TYPE=button name=none3 value="wasda2aat UN/PW" onclick="end('</BODY></HTML>')"></td>
    			<td colspan="2"><INPUT TYPE=button name=none3 value="waasdfasf2aat UN/PW" onclick="end('</BODY></HTML>')"></td>
    		</tr>
    		</tbody>
     
    </table>
    <p>
     
     
    <table border=0>
     
    	<tr>
    		<td onclick="expandcontract('ARow1','AClickIcon1')" id="AClickIcon1" style="cursor: pointer; cursor: hand;">+</td>
    		<td>table2</td>
    	</tr>
     
    		<tbody id="ARow1" style="display:none">
    		<tr>
    			<td colspan="2"><INPUT TYPE=button name=none3 value="w1aaat UN/PW" onclick="end('</BODY></HTML>')"></td>
    			<td colspan="2"><INPUT TYPE=button name=none3 value="wa2aat UN/PW" onclick="end('</BODY></HTML>')"></td>
    		</tr>
    		<tr>
     
    			<td colspan="2"><INPUT TYPE=button name=none3 value="wat UN/PW" onclick="end('</BODY></HTML>')"></td>	
    			<td colspan="2"><INPUT TYPE=button name=none3 value="wa2aat UN/PW" onclick="end('</BODY></HTML>')"></td>
    			<td colspan="2"><INPUT TYPE=button name=none3 value="wasda2aat UN/PW" onclick="end('</BODY></HTML>')"></td>
    			<td colspan="2"><INPUT TYPE=button name=none3 value="waasdfasf2aat UN/PW" onclick="end('</BODY></HTML>')"></td>
    		</tr>
    		</tbody>
     
    </table>
    <p>
    <table border=0>
     
    	<tr>
    		<td onclick="expandcontract('BRow1','BClickIcon1')" id="BClickIcon1" style="cursor: pointer; cursor: hand;">+</td>
    		<td>table3</td>
    	</tr>
     
    		<tbody id="BRow1" style="display:none">
    		<tr>
    			<td colspan="2"><INPUT TYPE=button name=none3 value="w1aaat UN/PW" onclick="end('</BODY></HTML>')"></td>
    			<td colspan="2"><INPUT TYPE=button name=none3 value="wa2aat UN/PW" onclick="end('</BODY></HTML>')"></td>
    		</tr>
    		<tr>
     
    			<td colspan="2"><INPUT TYPE=button name=none3 value="wat UN/PW" onclick="end('</BODY></HTML>')"></td>	
    			<td colspan="2"><INPUT TYPE=button name=none3 value="wa2aat UN/PW" onclick="end('</BODY></HTML>')"></td>
    			<td colspan="2"><INPUT TYPE=button name=none3 value="wasda2aat UN/PW" onclick="end('</BODY></HTML>')"></td>
    			<td colspan="2"><INPUT TYPE=button name=none3 value="waasdfasf2aat UN/PW" onclick="end('</BODY></HTML>')"></td>
    		</tr>
    		</tbody>
     
    </table>
    <p>
    <table border=0>
     
    	<tr>
    		<td onclick="expandcontract('CRow1','CClickIcon1')" id="CClickIcon1" style="cursor: pointer; cursor: hand;">+</td>
    		<td>table4</td>
    	</tr>
     
    		<tbody id="CRow1" style="display:none">
    		<tr>
    			<td colspan="2"><INPUT TYPE=button name=none3 value="w1aaat UN/PW" onclick="end('</BODY></HTML>')"></td>
    			<td colspan="2"><INPUT TYPE=button name=none3 value="wa2aat UN/PW" onclick="end('</BODY></HTML>')"></td>
    		</tr>
    		<tr>
     
    			<td colspan="2"><INPUT TYPE=button name=none3 value="wat UN/PW" onclick="end('</BODY></HTML>')"></td>	
    			<td colspan="2"><INPUT TYPE=button name=none3 value="wa2aat UN/PW" onclick="end('</BODY></HTML>')"></td>
    			<td colspan="2"><INPUT TYPE=button name=none3 value="wasda2aat UN/PW" onclick="end('</BODY></HTML>')"></td>
    			<td colspan="2"><INPUT TYPE=button name=none3 value="waasdfasf2aat UN/PW" onclick="end('</BODY></HTML>')"></td>
    		</tr>
    		</tbody>
     
    </table>
     
    <p>
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
    </form>
    </body>
     
    </html>

  • #4
    New to the CF scene
    Join Date
    May 2011
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    that worked. so what i want is when that clear notes button is clicked. it not only resets the textarea but also hides all the tables that i have opened and make it look like when i first open the page.


  •  

    Tags for this Thread

    Posting Permissions

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