|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
forms and multiple tabs
hi there
I have some code that will generate a page with multiple tabs. (it uses CSS) what I want to do is have each tab be a section of a form. imagine a huge form with 150 fields for instance. take that form and put 50 fields in each of the three tabs. now, what I would like is for the user to be able to go on tab one, fill out his/her info, then go to tab 2 and continue and then three... once done they would hit the submit button and all info from all three tabs would be sent out to be processed (added to DB in my case) what is the easiest way to accomplish this?? also, once the user is on tab two..can he come back to tab 1 and still see all the info they put in? or would it disappear.? once it would reload that page, wouldn’t all info be lost ? or is there a way to do this? if you need more info to understand let me know and I’ll try and explain myself better Pabs |
|
#2
|
||||
|
||||
|
RE: forms and multiple tabs
there are imho 2 ways to archieve that.
First one is client-side, second one is server side. Client Side solution would be javascript. You will have to put all your items in one huge form, dividing it up into several <div> tags. All, except the first one are hidden by default. If you click on "tab2", all divs will be set to hidden via javascript, except of the second one. Since it is *one* page, that does not need to be reloaded, no data is lost. Disadvantages: users may have JS disabled, users may click the "back" button of their browser to return to tab one, which means they might ruin *all* their inputs. ja for hiding / unhiding div elements: Code:
function hide(id) {
document.getElementById(id).style.display='none';
}
function show(id){
document.getElementById(id).style.display='block';
}
second one would be php, you just have to store every input made in lots of hidden fields, since the page is reloaded by advancing one tab. |
|
#3
|
|||
|
|||
|
RE: forms and multiple tabs
thanks...did end up finding some code...will use JS for the time being... the users that will use this form will have it on
thanks |
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Client Side Things > forms and multiple tabs |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|