Results 1 to 2 of 2

Thread: Show/Hide Div

  1. #1
    Join Date
    Mar 2006
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Show/Hide Div

    I've got a form defined inside a DIV. When the page first loads this DIV is hidden and then when a particular button is clicked, the div (and more importantly the form) is supposed to be shown. But when the button is clicked the div doesn't show up.

    This is the code I'm using to try and show the div (it's part of a function that runs with an onclick event from one of my buttons--I've confirmed that function IS running when I click the button):
    Code:
            document.getElementById("frm").style.display="block";
    This is the XHTML code that builds my div:
    Code:
    <div name="frm" style="display:none"><br>Hello!<br><form name="f1"><table>
    	<tr><td colspan="3">Click on an item in either field list to see the purpose/meaning of each.</td></tr>
    	<!-- <tr><td><input type="textarea" name="t1"</td></tr> -->
    	<tr>
    		<td valign="top">
    			<select name=IdxAvailable size="10" onchange="changetext(fldNames[this.options[this.selectedIndex].value])">
    			<!--	javascript function will build this select list  -->
    			</select>
    		</td>
    		<td valign="center">
    			<input type="button" onclick="addItem()" value="&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Add >&nbsp;&nbsp;&nbsp;&nbsp;"><br>
    			<input type="button" value="< Remove" onclick="removeItem()">
    
    		</td>
    		<td valign="top">
    			<select name="IdxUsed" size="9" onchange="changetext(fldNames[this.options[this.selectedIndex].value])"> -->
    			<!--	javascript function will build this select list  -->
    			</select><br>
    			<input type="button" value="Move Up" name="MoveUp" onclick="moveUp()"><input type="button" value="MoveDn" name="Move Down" onclick="moveDn()">
    		</td>
    		<td>&nbsp;</td>
    		<td width="500" valign="top">
    			<ilayer id="d1" width="200" height="200" visibility="hide">
    			<layer id="d2" width="200" height="200">
    			<div id="descriptions" align="left">
    
                                 <!--	javascript function add text here  -->
    
    			</div>
    			</layer>
    			</ilayer>
    		</td>
    	</tr>
    	<tr>
    	</tr>
    </table></form> </div>

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Code:
    <div name="frm"
    Code:
    document.getElementById("frm")
    Notice anything?
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

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
  •