insert TAB

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ddtpmyra
    Contributor
    • Jun 2008
    • 333

    insert TAB

    Hi Im having dificulty of controlling the display inside my tab let say I have two tabs A and B, what I have on tab A also shows on tab B although I used close tags at the end? Can anyone take a look what Im missing?

    Code:
      echo '
          </table>' . ( $useTabs ? '
        </div>' : '
        </fieldset>' ) . '
    
    <!-- REPEATING INFO -->';
      if ( $DISABLE_RECAP_FIELD != 'Y' ) {
        echo ( $useTabs ? '
        <a name="tabrecap"></a>
        <div id="tabscontent_recap">' : '
        <fieldset>
          <legend>' . translate ( 'Recap' ) . '</legend>' ) . '
          <table border="0" cellspacing="0" cellpadding="3" summary="">
            <tr>
          <td class="tooltip" title="' . tooltip ( 'repeat-type-help' )
         . '"><label for="rpttype">' . translate ( 'Type' ) . ':</label></td>
              </td>
          </tr>
        </table>' . ( $useTabs ? '
        </div> <!-- End tabscontent_recap -->' : '
        </fieldset>' );
      }
  • TheServant
    Recognized Expert Top Contributor
    • Feb 2008
    • 1168

    #2
    Don't know why this was moved to html-css? Anyway, what is the variable $useTabs? I haven't seen that " ? ' " syntax before, but it is quite possibley just a form of something I have never tried.

    Once your page has printed, have a look at the HTML output and see html-wise what's going wrong and then you can fix your PHP.

    Comment

    • Markus
      Recognized Expert Expert
      • Jun 2007
      • 6092

      #3
      Because this is an HTML problem. PHP servers the HTML, yes, but it's an error with his HTML - not PHP.

      Anyway, he's using the ternary operator syntax ( ( condition ) ? true : false )

      Comment

      • TheServant
        Recognized Expert Top Contributor
        • Feb 2008
        • 1168

        #4
        Thanks Markus. I just saw that there is still some conditional html output so I didn't rule out PHP error. Speaking of which, ddtpmyra, have you tried what I suggested?

        Comment

        • ddtpmyra
          Contributor
          • Jun 2008
          • 333

          #5
          Here's what I got the text 'Hello' still showing on other tabs

          PHP

          Code:
            if ( $DISABLE_RECAP_FIELD != 'Y' ) {
              echo ( $useTabs ? '
              <a name="tabrecap"></a>
              <div id="tabscontent_recap">' : '
              <fieldset>
                <legend>' . translate ( 'Recap' ) . '</legend>' ) . '
                <table border="0" cellspacing="0" cellpadding="3" summary="">
                  <tr>
                <td> Hello </td>
                </tr>
              </table>' . ( $useTabs ? '
              </div> <!-- End tabscontent_recap -->' : '
              </fieldset>' );
            }

          HTML

          Code:
          <!-- REPEATING INFO -->
              <a name="tabrecap"></a>
              <div id="tabscontent_recap">
                <table border="0" cellspacing="0" cellpadding="3" summary="">
                  <tr>
                <td> Hello </td>
                </tr>
              </table>
              </div> <!-- End tabscontent_recap -->

          Comment

          • TheServant
            Recognized Expert Top Contributor
            • Feb 2008
            • 1168

            #6
            I only see one "Hello" table in your html? What do you mean "repeating info"?

            In your PHP, you only have one code generation which is run if $DISABLE_RECAP_ FIELD != 'Y' so I don't see why you would have any "Hello" output unless it is running again? Need more info.

            Comment

            • ddtpmyra
              Contributor
              • Jun 2008
              • 333

              #7
              Hi sorry for not explaining the problem clearly.

              I created like three sets of tabs with different name and different txt inside. But the texts for each tabs are displayed on every tabs. I thought using </div> and </fieldset> it should end each tabs contents, is there any ways to do this?

              Comment

              • David Laakso
                Recognized Expert Contributor
                • Aug 2008
                • 397

                #8
                No clue here as far as whatever that stuff is you got. The below is html/css to yield a page with four tabs on it. Obviously, you'll want to delete one, as I guess you only need three.

                Please make the tabbed page, and move it and your question, to whatever the appropriate board is on this forum, in order to attach whatever the behavior is wish your three tabs to perform for you (if any).

                Code:
                <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
                	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
                
                <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
                <head>
                	<title>Tabs </title>
                	<style type="text/css" media="all">
                	
                	body {
                		font: 1em arial, helvetica, sans-serif;
                	}
                	
                	#header ul {
                		list-style: none;
                		padding: 0;
                		margin: 0;
                	}
                	
                	#header li {
                		display: inline;
                		border: 1px solid;
                		border-bottom-width: 0;
                		margin: 0 0.5em 0 0;
                	}
                	
                	#header li a {
                		padding: 0 1em;
                	}
                	
                	#header #selected {
                		padding-bottom: 1px;
                		background: white;
                	}
                	
                	#content {
                		border: 1px solid;
                	}
                	
                	</style>
                </head>
                
                <body>
                
                <div id="header">
                
                <h1>Tabs</h1>
                
                <ul>
                	<li><a href="#">This</a></li>
                	<li id="selected"><a href="#">That</a></li>
                	<li><a href="#">The Other</a></li>
                	<li><a href="#">Banana</a></li>
                </ul>
                
                </div>
                
                <div id="content">
                	<p>Ispum schmipsum.</p>
                </div>
                
                </body>
                </html>

                Comment

                Working...