Solved

web forms with multiple tabs

Posted on 2004-03-22
3
1,988 Views
Last Modified: 2007-12-19
I'm having problems implementing web forms with multiple tabs. I want to store a range of input data from these multiple tabs into a database.

I use a DIV for each TAB and javascript functions to enable and disable the tabs.
1st problem: When the page is first loaded I call the showPanel(1) to make the first tab visible and others 'hidden'. Although I set other tabs as 'hidden', I still can go to other tabs before completing the form on the first tab. How do I make it totally disable?

2nd problem: I call showpanel(1) when the page is loaded. e.g. <body onLoad="showPanel(1)">. So, everytime I refine the listbox on other tabs (e.g. tab 2, 3) and the page is refreshed, it always go back to the first tab. How do I refresh the page is make it stay on the same tab?

I use javascript, html and pl/sql
 <-- Java script -->
function showPanel(panelNum){
     //hide visible panel, show selected panel, set tab
           if (currentPanel != null) {
          hidePanel();
     }
         document.getElementById("panel"+panelNum).style.visibility = "visible";
        currentPanel = panelNum;
        setState(panelNum);
     }

     function hidePanel(){
        //hide visible panel, unhilite tab
        document.getElementById("panel"+currentPanel).style.visibility = "hidden";
        document.getElementById("tab"+currentPanel).style.backgroundColor = "#ffffff";
        Document.getElementById("tab"+currentPanel).style.color = "navy";
     }

     function setState(tabNum){
          if(tabNum==currentPanel){
               document.getElementById("tab"+tabNum).style.backgroundColor = "#ddddff";
               document.getElementById("tab"+tabNum).style.color = "red";
          }else{
               document.getElementById("tab"+tabNum).style.backgroundColor = "#ffffff";
               document.getElementById("tab"+tabNum).style.color = "navy";
          }
     }
 
many thanks,
0
Comment
Question by:denz_1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 63

Accepted Solution

by:
Zvonko earned 125 total points
ID: 10648561
A#1: your showpanel(2) needs a state var to allow or disalow swaping the tabs.
A#2: for onLoad you need a showpanel() version WITHOUT tab number to lookup last stored tab number from cookie or from a hidden field.

Show your page for more details.

0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question