techker Posted March 23, 2012 Share Posted March 23, 2012 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.. Quote Link to comment https://forums.phpfreaks.com/topic/259581-tabed-admin/ Share on other sites More sharing options...
Psycho Posted March 23, 2012 Share Posted March 23, 2012 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. Quote Link to comment https://forums.phpfreaks.com/topic/259581-tabed-admin/#findComment-1330582 Share on other sites More sharing options...
techker Posted March 23, 2012 Author Share Posted March 23, 2012 i like the second one.. so there would be a submit on each tab?but how would the second submit relate to the first submit? so first tab is and insert and second is an update.. Quote Link to comment https://forums.phpfreaks.com/topic/259581-tabed-admin/#findComment-1330583 Share on other sites More sharing options...
Psycho Posted March 23, 2012 Share Posted March 23, 2012 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. Quote Link to comment https://forums.phpfreaks.com/topic/259581-tabed-admin/#findComment-1330588 Share on other sites More sharing options...
techker Posted March 23, 2012 Author Share Posted March 23, 2012 ok good.would you know of a tutorial for this?just to give me an idea? Quote Link to comment https://forums.phpfreaks.com/topic/259581-tabed-admin/#findComment-1330590 Share on other sites More sharing options...
Psycho Posted March 23, 2012 Share Posted March 23, 2012 I've seen some before, but I have no clue what the titles were to search on. Try something along the line of paginated or multi page forms. Quote Link to comment https://forums.phpfreaks.com/topic/259581-tabed-admin/#findComment-1330594 Share on other sites More sharing options...
techker Posted March 23, 2012 Author Share Posted March 23, 2012 ok thx for the help Quote Link to comment https://forums.phpfreaks.com/topic/259581-tabed-admin/#findComment-1330596 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.