Hey guys,
I've got a form that has about 45 different fields. It's a 'settings manager' for a script i'm writing.
The form as a whole works perfectly but to someone who's never looked at it before, it may look a little daunting.
I wanted to break it down into chunks - having an unordered list containing links.
when a certain link is clicked, only that part of the form is shown. I have this down - no problem.
The main issue i'm having is - How can i get the rest of the form, that's not shown, submit along w/the show portion?
Basically, i'm breaking it down like this:
<?php
# not all actual code - just examples
if($_GET['show'] == "showall")
{ $begin_comment='';
$end_comment='';
} else {
$begin_comment = "\r\n<!--";
$end_comment = "-->\r\n";
}
if(empty($_GET['show'])) { # if show is empty, show the list of links
?>
<ul>
<li><a title="Address, City, State, Zip, Phone, E-mail, Company Name" href="<?php echo "$self?$tab_query&do=$do"; ?>&show=location">Location Settings</a>
<ul>
<?php }
if($_GET['show'] != "location") { echo "$begin_comment"; } ?>
form here
<?php }
if($_GET['show'] != "location") { echo "$end_comment"; } ?>
So, if show is not set, the list is displayed. When the links are clicked, the chunks of the form I want to display are displayed & the rest is commented out resulting in those sections not being posted.
The script itself is huge - at least for me. It's the biggest project i've ever done and I don't want to make it any larger by seperating the form into chunks with its own form processing code. I want it all to process w/the click of one button, while only showing a particular section of the form.
I've tried several different ways that I thought might work, but have had no luck. I'm starting to think i'm going to have to break it down into chunks and just include them when necessary.
If anyone could point me in the right direction, I would be greatly appreciative!