469,299 Members | 2,081 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,299 developers. It's quick & easy.

insert TAB

ddtpmyra
333 100+
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?

Expand|Select|Wrap|Line Numbers
  1.   echo '
  2.       </table>' . ( $useTabs ? '
  3.     </div>' : '
  4.     </fieldset>' ) . '
  5.  
  6. <!-- REPEATING INFO -->';
  7.   if ( $DISABLE_RECAP_FIELD != 'Y' ) {
  8.     echo ( $useTabs ? '
  9.     <a name="tabrecap"></a>
  10.     <div id="tabscontent_recap">' : '
  11.     <fieldset>
  12.       <legend>' . translate ( 'Recap' ) . '</legend>' ) . '
  13.       <table border="0" cellspacing="0" cellpadding="3" summary="">
  14.         <tr>
  15.       <td class="tooltip" title="' . tooltip ( 'repeat-type-help' )
  16.      . '"><label for="rpttype">' . translate ( 'Type' ) . ':</label></td>
  17.           </td>
  18.       </tr>
  19.     </table>' . ( $useTabs ? '
  20.     </div> <!-- End tabscontent_recap -->' : '
  21.     </fieldset>' );
  22.   }
  23.  
  24.  
Mar 10 '09 #1
7 5257
TheServant
1,168 Expert 1GB
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.
Mar 10 '09 #2
Markus
6,050 Expert 4TB
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 )
Mar 10 '09 #3
TheServant
1,168 Expert 1GB
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?
Mar 11 '09 #4
ddtpmyra
333 100+
Here's what I got the text 'Hello' still showing on other tabs

PHP

Expand|Select|Wrap|Line Numbers
  1.   if ( $DISABLE_RECAP_FIELD != 'Y' ) {
  2.     echo ( $useTabs ? '
  3.     <a name="tabrecap"></a>
  4.     <div id="tabscontent_recap">' : '
  5.     <fieldset>
  6.       <legend>' . translate ( 'Recap' ) . '</legend>' ) . '
  7.       <table border="0" cellspacing="0" cellpadding="3" summary="">
  8.         <tr>
  9.       <td> Hello </td>
  10.       </tr>
  11.     </table>' . ( $useTabs ? '
  12.     </div> <!-- End tabscontent_recap -->' : '
  13.     </fieldset>' );
  14.   }
  15.  
  16.  

HTML

Expand|Select|Wrap|Line Numbers
  1. <!-- REPEATING INFO -->
  2.     <a name="tabrecap"></a>
  3.     <div id="tabscontent_recap">
  4.       <table border="0" cellspacing="0" cellpadding="3" summary="">
  5.         <tr>
  6.       <td> Hello </td>
  7.       </tr>
  8.     </table>
  9.     </div> <!-- End tabscontent_recap -->
  10.  
Mar 12 '09 #5
TheServant
1,168 Expert 1GB
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.
Mar 12 '09 #6
ddtpmyra
333 100+
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?
Mar 13 '09 #7
David Laakso
397 Expert 256MB
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).

Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  2.     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  3.  
  4. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
  5. <head>
  6.     <title>Tabs </title>
  7.     <style type="text/css" media="all">
  8.  
  9.     body {
  10.         font: 1em arial, helvetica, sans-serif;
  11.     }
  12.  
  13.     #header ul {
  14.         list-style: none;
  15.         padding: 0;
  16.         margin: 0;
  17.     }
  18.  
  19.     #header li {
  20.         display: inline;
  21.         border: 1px solid;
  22.         border-bottom-width: 0;
  23.         margin: 0 0.5em 0 0;
  24.     }
  25.  
  26.     #header li a {
  27.         padding: 0 1em;
  28.     }
  29.  
  30.     #header #selected {
  31.         padding-bottom: 1px;
  32.         background: white;
  33.     }
  34.  
  35.     #content {
  36.         border: 1px solid;
  37.     }
  38.  
  39.     </style>
  40. </head>
  41.  
  42. <body>
  43.  
  44. <div id="header">
  45.  
  46. <h1>Tabs</h1>
  47.  
  48. <ul>
  49.     <li><a href="#">This</a></li>
  50.     <li id="selected"><a href="#">That</a></li>
  51.     <li><a href="#">The Other</a></li>
  52.     <li><a href="#">Banana</a></li>
  53. </ul>
  54.  
  55. </div>
  56.  
  57. <div id="content">
  58.     <p>Ispum schmipsum.</p>
  59. </div>
  60.  
  61. </body>
  62. </html>
  63.  
  64.  
  65.  
Mar 13 '09 #8

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

3 posts views Thread by Howard Hinnant | last post: by
6 posts views Thread by Mark P | last post: by
16 posts views Thread by Philip Boonzaaier | last post: by
2 posts views Thread by Geoffrey KRETZ | last post: by
3 posts views Thread by MP | last post: by
6 posts views Thread by lenygold via DBMonster.com | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
1 post views Thread by Geralt96 | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.