Passing tbody data with sessions

I have a form has a drop down list which consists of 20 options. Each option has a tbody which consists of many fields. Almost all the fields inside the tbodies are repeated in every tbody . What I want to do is when I select an option I want t be able to send its tbody data only with the session.

Problem: when I do submit the form I can’t get the data in the other page

Note:[LIST=1]
[/LIST] the other tbodies are display:none ( Hidden) unless when its called it will be non-hidden to be sent.

[LIST=2]
[/LIST]the only option works correctly is the last one.

Thanks in advance for your help!

here is the form sample


<?php //error_reporting(0);
if (!isset($_SESSION)) {
  session_start();
}
session_start();
if(isset($_POST['tp_ser']))
{
  $_SESSION['name']=$_POST['tp_ser'];
  $_SESSION['name1']=$_POST['date_ser'];
  $_SESSION['name2']=$_POST['pck_up'];
  $_SESSION['name3']=$_POST['drop-off'];
 $_SESSION['name8']=$_POST['pass_nger'];
  // $_SESSION['name4']=$_POST['pck_up'];
  //$_SESSION['name5']=$_POST['time_to'];
  $_SESSION['name6']=$_POST['time_from'];
  $_SESSION['name7']=$_POST['airport'];
   //echo $_SESSION['name'];
   //echo $_SESSION['name1'];
   //echo $_SESSION['name2'];
   //echo $_SESSION['name3'];

}

?>
<script type="text/javascript">
// <![CDATA[
function display(obj,id1,id2,id3) {
txt = obj.options[obj.selectedIndex].value;
document.getElementById(id1).style.display = 'none';
document.getElementById(id2).style.display = 'none';
document.getElementById(id3).style.display = 'none';


if ( txt.match(id1) ) {
document.getElementById(id1).style.display = 'block';
}
if ( txt.match(id2) ) {
document.getElementById(id2).style.display = 'block';
}
if ( txt.match(id3) ) {
document.getElementById(id3).style.display = 'block';
}
}
// ]]>
</script>
      <form method="post"  id="form" action="<?php $_SERVER['PHP_SELF'];?>">
<table cellpadding="0" cellspacing="0" >
<tr><td><font face="Verdana, Geneva, sans-serif" color="#FFFFFF">Type of Service</font></td></tr>
<tr><td class="field"><select name="tp_ser" style="color:#666666" onchange="display(this,'Start here','To Airport','From Airport')">
<option value="Start here" selected="selected">Start here</option>
			  <optgroup label="Most Popular:">
			    <option value="To Airport">To Airport</option>
			    <option value="From Airport">From Airport</option>
               
                </optgroup>
			  </select></td></tr>
              <tbody id="Start here" style="display:block;">
              <tr><td class="text"><font face="Verdana, Geneva, sans-serif" color="#FFFFFF">Passengers</font></td></tr>
     <tr><td class="field"><select id="search_pax" style="color:#666666" name="pass_nger"><option value="">Select number</option>
<option value="1">1</option>
<option value="2">2</option>

<option value="50">50</option></select></td></tr>
              <tr><td class="text"><font face="Verdana, Geneva, sans-serif" color="#FFFFFF">Date of Service</font></td></tr>
     <tr><td class="field"><input name="date_ser" value="" type="text"  style="color:#666666"/></td></tr>
              
              
              
           
   <tr><td class="field"><font face="Verdana, Geneva, sans-serif" color="#FFFFFF">Time</font></td></tr><tr><td><select id="search_drop_off_time" name="time_to" style="color:#666666">
        <option value=''>Select Time</option>
        <option value="12:00"><b>NOON</b></option>
        <option value="12:30">12:30 PM</option>
        
      </select></td></tr>
      <tr><td class="text"><font face="Verdana, Geneva, sans-serif" color="#FFFFFF">Pick Up Address</font></td></tr>
      <tr><td class="field"><input name="pck_up" type="text"  value="" style="color:#666666"/></td></tr>
     
  
     <tbody id="To Airport" style="display:none;" >
     <tr><td class="text"><font face="Verdana, Geneva, sans-serif" color="#FFFFFF">Passengers</font></td></tr>
     <tr><td class="field"><select id="search_pax" style="color:#666666" name="pass_nger"><option value="">Select number</option>
<option value="1">1</option>
<option value="2">2</option>

<option value="50">50</option></select></td></tr>
      <tr><td class="text"><font face="Verdana, Geneva, sans-serif" color="#FFFFFF">Date of Service</font></td></tr>
     <tr><td class="field"><input name="date_ser" value="" type="text"  style="color:#666666"/></td></tr>
     
     <tr><td class="field"><font face="Verdana, Geneva, sans-serif" color="#FFFFFF">Time</font></td></tr><tr><td><select id="search_drop_off_time" name="time_to" style="color:#666666">
        <option value=''>Select Time</option>
        <option value="12:00"><b>NOON</b></option>
        <option value="12:30">12:30 PM</option>
       
      </select></td></tr>
     <tr><td class="text"><font face="Verdana, Geneva, sans-serif" color="#FFFFFF">Pick Up Address</font></td></tr>
     <tr><td class="field"><input name="pck_up3" type="text" style="color:#666666"/></td></tr>
    <tr><td><font face="Verdana, Geneva, sans-serif" color="#FFFFFF">Airport</font> </td></tr>
    <tr><td><select name="airport"style="color:#666666" >
          <option value="MOD"> Harry Sham Field</option>
          <option value="MRY"> Monterey Peninsula Airport</option>
        
      </select></td></tr>
     </tbody>
     
     <tbody id="From Airport" style="display:none;">
     <tr><td class="text"><font face="Verdana, Geneva, sans-serif" color="#FFFFFF">Passengers</font></td></tr>
     <tr><td class="field"><select id="search_pax" style="color:#666666" name="pass_nger"><option value="">Select number</option>
<option value="1">1</option>
<option value="2">2</option>

<option value="50">50</option></select></td></tr>
      <tr><td class="text"><font face="Verdana, Geneva, sans-serif" color="#FFFFFF">Date of Service</font></td></tr>
     <tr><td class="field"><input name="date_ser" value="" type="text"  style="color:#666666"/></td></tr>
     

    <tr><td class="field"><font face="Verdana, Geneva, sans-serif" color="#FFFFFF">Time</font></td></tr><tr><td><select id="search_drop_off_time" name="time_to" style="color:#666666">
        <option value=''>Select Time</option>
        <option value="12:00"><b>NOON</b></option>
        <option value="12:30">12:30 PM</option>
       
      </select></td></tr>
      <tr><td><font face="Verdana, Geneva, sans-serif" color="#FFFFFF">Airport</font> </td></tr>
     <tr><td class="field"><select name="airport"style="color:#666666" >
          <option value="MOD"> Harry Sham Field</option>
      
      </select></td></tr>
      
      <tr><td class="text"><font face="Verdana, Geneva, sans-serif" color="#FFFFFF">Drop off Address</font></td></tr>
      <tr><td class="field"><input type="text" name="drop-off" value="" style="color:#666666"/></td></tr>
     </tbody>
     
     
      <tr>
      <td  align="center"><br /><input type="submit" value="Find Limo" style="color:#015c93"/>
      <input type="reset" value="reset"  style="color:#015c93"/></td>
      </tr>
</table>
</form>

        

if u can see

those are the form options

<option value="Start here" selected="selected">Start here</option>
			  <optgroup label="Most Popular:">
			    <option value="To Airport">To Airport</option>
			    <option value="From Airport">From Airport</option>

when I choose “To Airport” its tbody will be called and shown and the same thing for any selected option

<tbody id="To Airport" style="display:none;" >
     <tr><td class="text"><font face="Verdana, Geneva, sans-serif" color="#FFFFFF">Passengers</font></td></tr>
     <tr><td class="field"><select id="search_pax" style="color:#666666" name="pass_nger"><option value="">Select number</option>
<option value="1">1</option>
<option value="2">2</option>

<option value="50">50</option></select></td></tr>
      <tr><td class="text"><font face="Verdana, Geneva, sans-serif" color="#FFFFFF">Date of Service</font></td></tr>
     <tr><td class="field"><input name="date_ser" value="" type="text"  style="color:#666666"/></td></tr>
     
     <tr><td class="field"><font face="Verdana, Geneva, sans-serif" color="#FFFFFF">Time</font></td></tr><tr><td><select id="search_drop_off_time" name="time_to" style="color:#666666">
        <option value=''>Select Time</option>
        <option value="12:00"><b>NOON</b></option>
        <option value="12:30">12:30 PM</option>
       
      </select></td></tr>
     <tr><td class="text"><font face="Verdana, Geneva, sans-serif" color="#FFFFFF">Pick Up Address</font></td></tr>
     <tr><td class="field"><input name="pck_up3" type="text" style="color:#666666"/></td></tr>
    <tr><td><font face="Verdana, Geneva, sans-serif" color="#FFFFFF">Airport</font> </td></tr>
    <tr><td><select name="airport"style="color:#666666" >
          <option value="MOD"> Harry Sham Field</option>
          <option value="MRY"> Monterey Peninsula Airport</option>
        
      </select></td></tr>
     </tbody>

I think you may need to explain it just a tad more clearly - I’m failing to grasp what it is your wanting to do / what purpose the form serves / why it needs to be in sessions / why you only need some etc.

OKie, all the repeated fields have the same names and values.

So, let me get this straight (as it would take me 90 minutes to get those three files with Hot Files restrictions!): you have a selection of forms, some of which are hidden, depending on the status of other elements on the page. What is shown is a form with values that are the same. This is then submitted and the values from this need to be used elsewhere?

Are ALL of the values going to be the same, so you could just use the same form? How / why are the used again in the next step?

okie, I might couldn’t explain it clearly. Let’s say,

Image 1 shows the form

Image 2 shows the firt toggle option

image 3 shows second toggle option

if u can take a look at the those images, imagine as you selected the first toggle option, a tbody with fields appear. Now, when I submit I want to get the enterd data in the another page, using session…, I need them by using sessions cus I have more than 20 select groupoptions

the problem is those fields are repeated in every <tbody id=“” name=“”></tbody>

and upon selecting and submiting the form, there is nothing posted in the another page!

now when the user submit what he selects, it would be post in the second.php page

but in the second.php page I only get the type of service option but the other fields are not shown or posted.