Jump to content

Recommended Posts

Hey guy i was wondering how to make a form with tabs tha correspond to the same.

 

Like lets say tab one description and name...

Tab 2 is the image associated to that first tab...

 

How can i make that?

 

 

its for an auto classifield script..

 

Cause there is lots of details so i wanted to spread them in tabs..

Link to comment
https://forums.phpfreaks.com/topic/259581-tabed-admin/
Share on other sites

There are different ways to handle this, each with benefits and drawbacks.

 

1. You can have one form for all the data but break up the form into different sections where only one section is displayed at a time using JavaScript. So, you get your tabbed display. But, it requires JavaScript which could pose it's own problems.

 

2. You can build your PHP script for the form so that you pass a tab id to it. When the script runs the first time you would default to tab 1 and the script builds that "tab", when the use clicks another tab use a JavaScript event to submit the form and pass a tab id for the one the user clicked. You can take the submitted data and store it (hidden fields, session data, hidden fields, etc.). So, basically each tab element is a submit button that will store the updated data for that tab.

 

3. Another solution is to simply make the tabs a "wizard" of sorts. This requires no JavaScript. When the user lands on the first tab there will be a button to submit the form and go to the next tab. As above, the data is submitted and stored somewhere.

 

It's all up to you really to determine how complicated you want to make it. One of the driving factors for me in determining the correct approach would be the validations needed. For example, if data on tab 1 will affect data on tab 2 that would likely influence my decision.

Link to comment
https://forums.phpfreaks.com/topic/259581-tabed-admin/#findComment-1330582
Share on other sites

Again, it is up to you. But, I would make the tabs act as submit buttons AND I would have a SAVE button to commit all the data. So, when the user clicks a tab it submits the form for that tab and saves the data for that tab abd displays the form for the selected tab. Only when the user clicks the SAVE button woudl you do the final processing of all the data.

Link to comment
https://forums.phpfreaks.com/topic/259581-tabed-admin/#findComment-1330588
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.