HTML & WEB-Design

Moderators: Jonathan
Number of threads: 1249
Number of posts: 3348

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Tabbed dialog contol Posted by sanjeevkumar on 30 Apr 2004 at 2:50 AM
tell me how to create the tabbed dialog control using
the HTML. As I am project that needs the tabbed dialog
control into a single form and which contains the 4 tabs
as result,contents,search and settings.

































Report
Re: Tabbed dialog contol Posted by Weirdofreak on 30 Apr 2004 at 7:53 AM
This message was edited by Weirdofreak at 2004-4-30 7:53:52

You forgot to say please.

If I understand correctly, you want to be able to click links and change the contents of a div, correct? Well, you can't do it with HTML alone. You need Javascript and CSS as well. Try this, although I haven't tested it:

<html>
  <head>
    <script language="javascript">
      function show (obj) {
        var ids = ['box1','box2','box3','box4'];
        for (i = 0; i < ids.length; i++) {
          if (obj == ids[i])
            document.getElementById(obj).style.display = 'block';
           else
            document.getElementById(ids[i]).style.display ='none';
        }
      }
    </script>
    <style type="text/css">
      div { display: none; }
      div.first { display: block; }
    </style>
  </head>
  <body>
    <a href="#" onclick="show('box1'); return false;">First tab</a>
    <a href="#" onclick="show('box2'); return false;">Second tab</a>
    <a href="#" onclick="show('box3'); return false;">Third tab</a>
    <a href="#" onclick="show('box4'); return false;">Fourth tab</a>
    <div id="box1" class="first">
      This shows to begin with.
    </div>
    <div id="box2" class="first">
      This doesn't.
    </div>
    <div id="box3" class="first">
      Nor this...
    </div>
    <div id="box4" class="first">
      ...or this.
    </div>
  </body>
</html>


Like I said, I haven't tested it, so it may completely fail to work. Play around with stlyes to make it look how you want.
Report
Re: Tabbed dialog contol Posted by sanjeevkumar on 4 May 2004 at 5:43 AM
: This message was edited by Weirdofreak at 2004-4-30 7:53:52

: You forgot to say please.
:
: If I understand correctly, you want to be able to click links and change the contents of a div, correct? Well, you can't do it with HTML alone. You need Javascript and CSS as well. Try this, although I haven't tested it:
:
:
<html>
:   <head>
:     <script language="javascript">
:       function show (obj) {
:         var ids = ['box1','box2','box3','box4'];
:         for (i = 0; i < ids.length; i++) {
:           if (obj == ids[i])
:             document.getElementById(obj).style.display = 'block';
:            else
:             document.getElementById(ids[i]).style.display ='none';
:         }
:       }
:     </script>
:     <style type="text/css">
:       div { display: none; }
:       div.first { display: block; }
:     </style>
:   </head>
:   <body>
:     <a href="#" onclick="show('box1'); return false;">First tab</a>
:     <a href="#" onclick="show('box2'); return false;">Second tab</a>
:     <a href="#" onclick="show('box3'); return false;">Third tab</a>
:     <a href="#" onclick="show('box4'); return false;">Fourth tab</a>
:     <div id="box1" class="first">
:       This shows to begin with.
:     </div>
:     <div id="box2" class="first">
:       This doesn't.
:     </div>
:     <div id="box3" class="first">
:       Nor this...
:     </div>
:     <div id="box4" class="first">
:       ...or this.
:     </div>
:   </body>
: </html>

:
: Like I said, I haven't tested it, so it may completely fail to work. Play around with stlyes to make it look how you want.
:

Report
Re: Tabbed dialog contol Posted by sanjeevkumar on 4 May 2004 at 5:45 AM
: : This message was edited by Weirdofreak at 2004-4-30 7:53:52

: : You forgot to say please.
: :
: : If I understand correctly, you want to be able to click links and change the contents of a div, correct? Well, you can't do it with HTML alone. You need Javascript and CSS as well. Try this, although I haven't tested it:
: :
: :
<html>
: :   <head>
: :     <script language="javascript">
: :       function show (obj) {
: :         var ids = ['box1','box2','box3','box4'];
: :         for (i = 0; i < ids.length; i++) {
: :           if (obj == ids[i])
: :             document.getElementById(obj).style.display = 'block';
: :            else
: :             document.getElementById(ids[i]).style.display ='none';
: :         }
: :       }
: :     </script>
: :     <style type="text/css">
: :       div { display: none; }
: :       div.first { display: block; }
: :     </style>
: :   </head>
: :   <body>
: :     <a href="#" onclick="show('box1'); return false;">First tab</a>
: :     <a href="#" onclick="show('box2'); return false;">Second tab</a>
: :     <a href="#" onclick="show('box3'); return false;">Third tab</a>
: :     <a href="#" onclick="show('box4'); return false;">Fourth tab</a>
: :     <div id="box1" class="first">
: :       This shows to begin with.
: :     </div>
: :     <div id="box2" class="first">
: :       This doesn't.
: :     </div>
: :     <div id="box3" class="first">
: :       Nor this...
: :     </div>
: :     <div id="box4" class="first">
: :       ...or this.
: :     </div>
: :   </body>
: : </html>

: :
: : Like I said, I haven't tested it, so it may completely fail to work. Play around with stlyes to make it look how you want.
: :
:
: very very Thank you Mr.Weirdofreak for help me. I worked on your given code and it worked. once again Thank you.




 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.