<div> problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • shivendravikramsingh
    New Member
    • Jun 2007
    • 19

    <div> problem

    hello friend,i m using this code[code=php]<div id="get" style="visibili ty:hidden"><? include "time_title.php " ?></div>[/code] in a php page,i want when page load the inclued page time_tiltle.php should not shown,when i click a button,it should appear.but i don't no wat.s the prob. when i open the page it showing the content of timr_title.php, the <div> visibility is hidden.i call a function in a button in which i m setting the visibilty of <div> 'visible'.but it' not working.second problem is that
    if i remove the <div> and call it in a table,the page is shown,but the content of page is not shown,if i run this page (time_title.php ) alone its working fine.but if include it on another page,it not shown,if u thinking about address prob.,there is no prob. of address,because both page r in same folder.also its not displaying over all element of form,means over textbox,combo box etc,the combo box is showing over it.i think u all r getting what i m trying to say.pls help me
  • henryrhenryr
    New Member
    • Jun 2007
    • 103

    #2
    &lt;div&gt; problem

    i m using this code<div id="get" style="visibili ty:hidden"><? include "time_title.php " ?></div>
    I think you're better off with style="display: none" to hide the div completely.

    in a php page,i want when page load the inclued page time_tiltle.php should not shown,when i click a button,it should appear.but i don't no wat.s the prob. when i open the page it showing the content of timr_title.php, the <div> visibility is hidden.i call a function in a button in which i m setting the visibilty of <div> 'visible'.but it' not working.
    Are you trying to use AJAX here? Perhaps Javascript would be a much easier solution. Have your button like this:
    Code:
    <input type="button" onclick="getElementById("get").style.display='block'" />
    Then your button will change the display of your div from 'none' to 'block'. If you're trying to use AJAX it's pretty complicated - and this is the PHP forum!

    second problem is that
    if i remove the <div> and call it in a table,the page is shown,but the content of page is not shown,if i run this page (time_title.php ) alone its working fine.but if include it on another page,it not shown,
    This must be a typing error. Check your HTML for unclosed tags - I get this all the time. Also if you install the web developer toolbar in firefox you can get a better idea about these errors. Or check the DOM reader in firefox.
    also its not displaying over all element of form,means over textbox,combo box etc,the combo box is showing over it
    Not sure what this means?

    Hope that helps ;) You could post some code and it would be easier to understand the problem!

    Comment

    • ak1dnar
      Recognized Expert Top Contributor
      • Jan 2007
      • 1584

      #3
      Originally posted by shivendravikram singh
      hello friend,i m using this code<div id="get" style="visibili ty:hidden"> in a php page,i want when page load the inclued page time_tiltle.php should not shown,when i click a button,it should appear.but i don't no wat.s the prob. when i open the page it showing the content of timr_title.php, the visibility is hidden.i call a function in a button in which i m setting the visibilty of 'visible'.but it' not working.second problem is that
      if i remove the <div> and call it in a table,the page is shown,but the content of page is not shown,if i run this page (time_title.php ) alone its working fine.but if include it on another page,it not shown,if u thinking about address prob.,there is no prob. of address,because both page r in same folder.also its not displaying over all element of form,means over textbox,combo box etc,the combo box is showing over it.i think u all r getting what i m trying to say.pls help me

      Originally posted by Ajaxrand
      Please Use Clear English to write your question in if possible, try to avoid using abbreviations.
      Try Like this.
      Thanks.

      [PHP]<html>
      <head>
      <script language="JavaS cript" type="text/javascript">
      function showhide(show){
      var obj = document.getEle mentById(show). style;
      if(!obj.display )
      obj.display = 'none';
      else
      obj.display = '';
      }
      </script>

      </head>
      <body>
      <input name="btn_show_ hide" type="button" value="show/hide" onclick="javasc ript:showhide(' mydiv');" />
      <div id="mydiv" style="display: none;">

      </body>
      </html>[/PHP]

      inc.php
      [PHP]<?php
      echo 'This Line is there at inc.php'
      ?>[/PHP]

      Comment

      Working...