Can a disabled form element share a column with an enabled form element?











up vote
0
down vote

favorite












Can a disabled form element share a column with an enabled form element?



I have a form which has 4 sets of comboboxes which are populated with data from another table and are only visible and active when certain selections are made, each set of coboboxes contains 4 possible option sets with either one or none visible and active at one time, I have set each set of comboboxes to save to the same table column because there will only ever be one that is working at any time so 4 seperate columns for each set of options would be too complicated when filtering data (in my mind at least).



The problem that I am having is that I am getting a blank value saved to the database table instead of the selected value, I have place the coding below to help explain what I am trying to do.



Form coding
visible/active options



<select name="Lab1" id="Lab1" style="visibility:hidden;" onChange="if (this.value=='Alpha Bio Labs'){this.form['Samp1'].style.visibility='visible'}
if (this.value=='Alpha Bio Labs'){this.form['Samp1'].disabled=false}
if (this.value=='Alpha Bio Labs'){this.form['Samp2'].style.visibility='hidden'}
if (this.value=='Alpha Bio Labs'){this.form['Samp2'].disabled=true}
if (this.value=='Alpha Bio Labs'){this.form['Samp3'].style.visibility='hidden'}
if (this.value=='Alpha Bio Labs'){this.form['Samp3'].disabled=true}
if (this.value=='Alpha Bio Labs'){this.form['Samp4'].style.visibility='hidden'}
if (this.value=='Alpha Bio Labs'){this.form['Samp4'].disabled=true}
if (this.value=='Alpha Bio Labs'){this.form['SegmCol1'].style.visibility='visible'}
if (this.value=='Alpha Bio Labs'){this.form['SegmCol1'].disabled=false}
if (this.value=='Cellmark'){this.form['Samp1'].style.visibility='hidden'}
if (this.value=='Cellmark'){this.form['Samp1'].disabled=true}
if (this.value=='Cellmark'){this.form['Samp2'].style.visibility='visible'}
if (this.value=='Cellmark'){this.form['Samp2'].disabled=false}
if (this.value=='Cellmark'){this.form['Samp3'].style.visibility='hidden'}
if (this.value=='Cellmark'){this.form['Samp3'].disabled=true}
if (this.value=='Cellmark'){this.form['Samp4'].style.visibility='hidden'}
if (this.value=='Cellmark'){this.form['Samp4'].disabled=true}
if (this.value=='Cellmark'){this.form['SegmCol1'].style.visibility='visible'}
if (this.value=='Cellmark'){this.form['SegmCol1'].disabled=false}
if (this.value=='DNA Legal'){this.form['Samp1'].style.visibility='hidden'}
if (this.value=='DNA Legal'){this.form['Samp1'].disabled=true}
if (this.value=='DNA Legal'){this.form['Samp2'].style.visibility='hidden'}
if (this.value=='DNA Legal'){this.form['Samp2'].disabled=true}
if (this.value=='DNA Legal'){this.form['Samp3'].style.visibility='visible'}
if (this.value=='DNA Legal'){this.form['Samp3'].disabled=false}
if (this.value=='DNA Legal'){this.form['Samp4'].style.visibility='hidden'}
if (this.value=='DNA Legal'){this.form['Samp4'].disabled=true}
if (this.value=='DNA Legal'){this.form['SegmCol1'].style.visibility='visible'}
if (this.value=='DNA Legal'){this.form['SegmCol1'].disabled=false}
if (this.value=='The Doctors Lab'){this.form['Samp1'].style.visibility='hidden'}
if (this.value=='The Doctors Lab'){this.form['Samp1'].disabled=true}
if (this.value=='The Doctors Lab'){this.form['Samp2'].style.visibility='hidden'}
if (this.value=='The Doctors Lab'){this.form['Samp2'].disabled=true}
if (this.value=='The Doctors Lab'){this.form['Samp3'].style.visibility='hidden'}
if (this.value=='The Doctors Lab'){this.form['Samp3'].disabled=true}
if (this.value=='The Doctors Lab'){this.form['Samp4'].style.visibility='visible'}
if (this.value=='The Doctors Lab'){this.form['Samp4'].disabled=false}
if (this.value=='The Doctors Lab'){this.form['SegmCol1'].style.visibility='visible'}
if (this.value=='The Doctors Lab'){this.form['SegmCol1'].disabled=false}
if (this.value=='Lab'){this.form['Samp1'].style.visibility='hidden'}
if (this.value=='Lab'){this.form['Samp1'].disabled=true}
if (this.value=='Lab'){this.form['Samp2'].style.visibility='hidden'}
if (this.value=='Lab'){this.form['Samp2'].disabled=true}
if (this.value=='Lab'){this.form['Samp3'].style.visibility='hidden'}
if (this.value=='Lab'){this.form['Samp3'].disabled=true}
if (this.value=='Lab'){this.form['Samp4'].style.visibility='hidden'}
if (this.value=='Lab'){this.form['Samp4'].disabled=true}
if (this.value=='Lab'){this.form['SegmCol1'].style.visibility='hidden'}
if (this.value=='Lab'){this.form['SegmCol1'].disabled=true};">
<option selected>Lab</option>
<option value="Alpha Bio Labs">Alpha Bio Labs</option>
<option value="Cellmark">Cellmark</option>
<option value="DNA Legal">DNA Legal</option>
<option value="The Doctors Lab">The Doctors Lab</option>
</select>


Selection that will be saved to the database



 <option selected >Select Sample Type</option>
<?php
$connection = mysqli_connect("", "", "", "");

$results = mysqli_query($connection, "SELECT SampleType, LabFee, LabFeeExtra FROM `sampletypes` WHERE Lab = 'Alpha Bio Labs'");

mysqli_close($connection);
foreach($results as $user): ?>
<option value="<?= $user['SampleType']; ?>">
<?= $user['SampleType']; ?>
</option>
<?php endforeach; ?>
</select>


php coding to save to the database



$LaborDept = $_POST['Lab1'];
$SampleType1 = $_POST['Samp1'];
$SampleType1 = $_POST['Samp2'];
$SampleType1 = $_POST['Samp3'];
$SampleType1 = $_POST['Samp4'];
$Segmented1 = $_POST['SegmCol1'];
$LaborDept2 = $_POST['Lab2'];
$SampleType2 = $_POST['Samp5'];
$SampleType2 = $_POST['Samp6'];
$SampleType2 = $_POST['Samp7'];
$SampleType2 = $_POST['Samp8'];
$Segmented2 = $_POST['SegmCol2'];
$LaborDept3 = $_POST['Lab3'];
$SampleType3 = $_POST['Samp9'];
$SampleType3 = $_POST['Samp10'];
$SampleType3 = $_POST['Samp11'];
$SampleType3 = $_POST['Samp12'];
$Segmented3 = $_POST['SegmCol3'];
$LaborDept4 = $_POST['Lab4'];
$SampleType4 = $_POST['Samp13'];
$SampleType4 = $_POST['Samp14'];
$SampleType4 = $_POST['Samp15'];
$SampleType4 = $_POST['Samp16'];
$SegmentedCollection = $_POST['SegmCol'];
$Decleration = $_POST['Decl'];

mysqli_query($connection, "INSERT INTO `collectsamp`(`SampleID`, `LaborDept`, `NumberofSamples`, `SampleType1`, `Segmented1`, `LaborDept2`, `SampleType2`, `Segmented2`, `LaborDept3`, `SampleType3`, `Segmented3`, `LaborDept4`, `SampleType4`, `SegmentedCollection`, `Decleration`) VALUES ('$LabID', '$LaborDept', '$NumberofSamples', '$SampleType1', '$Segmented1', '$LaborDept2', '$SampleType2', '$Segmented2', '$LaborDept3', '$SampleType3', '$Segmented3', '$LaborDept4', '$SampleType4', '$SegmentedCollection', '$Decleration')");


Any help would be very much appreciated










share|improve this question




























    up vote
    0
    down vote

    favorite












    Can a disabled form element share a column with an enabled form element?



    I have a form which has 4 sets of comboboxes which are populated with data from another table and are only visible and active when certain selections are made, each set of coboboxes contains 4 possible option sets with either one or none visible and active at one time, I have set each set of comboboxes to save to the same table column because there will only ever be one that is working at any time so 4 seperate columns for each set of options would be too complicated when filtering data (in my mind at least).



    The problem that I am having is that I am getting a blank value saved to the database table instead of the selected value, I have place the coding below to help explain what I am trying to do.



    Form coding
    visible/active options



    <select name="Lab1" id="Lab1" style="visibility:hidden;" onChange="if (this.value=='Alpha Bio Labs'){this.form['Samp1'].style.visibility='visible'}
    if (this.value=='Alpha Bio Labs'){this.form['Samp1'].disabled=false}
    if (this.value=='Alpha Bio Labs'){this.form['Samp2'].style.visibility='hidden'}
    if (this.value=='Alpha Bio Labs'){this.form['Samp2'].disabled=true}
    if (this.value=='Alpha Bio Labs'){this.form['Samp3'].style.visibility='hidden'}
    if (this.value=='Alpha Bio Labs'){this.form['Samp3'].disabled=true}
    if (this.value=='Alpha Bio Labs'){this.form['Samp4'].style.visibility='hidden'}
    if (this.value=='Alpha Bio Labs'){this.form['Samp4'].disabled=true}
    if (this.value=='Alpha Bio Labs'){this.form['SegmCol1'].style.visibility='visible'}
    if (this.value=='Alpha Bio Labs'){this.form['SegmCol1'].disabled=false}
    if (this.value=='Cellmark'){this.form['Samp1'].style.visibility='hidden'}
    if (this.value=='Cellmark'){this.form['Samp1'].disabled=true}
    if (this.value=='Cellmark'){this.form['Samp2'].style.visibility='visible'}
    if (this.value=='Cellmark'){this.form['Samp2'].disabled=false}
    if (this.value=='Cellmark'){this.form['Samp3'].style.visibility='hidden'}
    if (this.value=='Cellmark'){this.form['Samp3'].disabled=true}
    if (this.value=='Cellmark'){this.form['Samp4'].style.visibility='hidden'}
    if (this.value=='Cellmark'){this.form['Samp4'].disabled=true}
    if (this.value=='Cellmark'){this.form['SegmCol1'].style.visibility='visible'}
    if (this.value=='Cellmark'){this.form['SegmCol1'].disabled=false}
    if (this.value=='DNA Legal'){this.form['Samp1'].style.visibility='hidden'}
    if (this.value=='DNA Legal'){this.form['Samp1'].disabled=true}
    if (this.value=='DNA Legal'){this.form['Samp2'].style.visibility='hidden'}
    if (this.value=='DNA Legal'){this.form['Samp2'].disabled=true}
    if (this.value=='DNA Legal'){this.form['Samp3'].style.visibility='visible'}
    if (this.value=='DNA Legal'){this.form['Samp3'].disabled=false}
    if (this.value=='DNA Legal'){this.form['Samp4'].style.visibility='hidden'}
    if (this.value=='DNA Legal'){this.form['Samp4'].disabled=true}
    if (this.value=='DNA Legal'){this.form['SegmCol1'].style.visibility='visible'}
    if (this.value=='DNA Legal'){this.form['SegmCol1'].disabled=false}
    if (this.value=='The Doctors Lab'){this.form['Samp1'].style.visibility='hidden'}
    if (this.value=='The Doctors Lab'){this.form['Samp1'].disabled=true}
    if (this.value=='The Doctors Lab'){this.form['Samp2'].style.visibility='hidden'}
    if (this.value=='The Doctors Lab'){this.form['Samp2'].disabled=true}
    if (this.value=='The Doctors Lab'){this.form['Samp3'].style.visibility='hidden'}
    if (this.value=='The Doctors Lab'){this.form['Samp3'].disabled=true}
    if (this.value=='The Doctors Lab'){this.form['Samp4'].style.visibility='visible'}
    if (this.value=='The Doctors Lab'){this.form['Samp4'].disabled=false}
    if (this.value=='The Doctors Lab'){this.form['SegmCol1'].style.visibility='visible'}
    if (this.value=='The Doctors Lab'){this.form['SegmCol1'].disabled=false}
    if (this.value=='Lab'){this.form['Samp1'].style.visibility='hidden'}
    if (this.value=='Lab'){this.form['Samp1'].disabled=true}
    if (this.value=='Lab'){this.form['Samp2'].style.visibility='hidden'}
    if (this.value=='Lab'){this.form['Samp2'].disabled=true}
    if (this.value=='Lab'){this.form['Samp3'].style.visibility='hidden'}
    if (this.value=='Lab'){this.form['Samp3'].disabled=true}
    if (this.value=='Lab'){this.form['Samp4'].style.visibility='hidden'}
    if (this.value=='Lab'){this.form['Samp4'].disabled=true}
    if (this.value=='Lab'){this.form['SegmCol1'].style.visibility='hidden'}
    if (this.value=='Lab'){this.form['SegmCol1'].disabled=true};">
    <option selected>Lab</option>
    <option value="Alpha Bio Labs">Alpha Bio Labs</option>
    <option value="Cellmark">Cellmark</option>
    <option value="DNA Legal">DNA Legal</option>
    <option value="The Doctors Lab">The Doctors Lab</option>
    </select>


    Selection that will be saved to the database



     <option selected >Select Sample Type</option>
    <?php
    $connection = mysqli_connect("", "", "", "");

    $results = mysqli_query($connection, "SELECT SampleType, LabFee, LabFeeExtra FROM `sampletypes` WHERE Lab = 'Alpha Bio Labs'");

    mysqli_close($connection);
    foreach($results as $user): ?>
    <option value="<?= $user['SampleType']; ?>">
    <?= $user['SampleType']; ?>
    </option>
    <?php endforeach; ?>
    </select>


    php coding to save to the database



    $LaborDept = $_POST['Lab1'];
    $SampleType1 = $_POST['Samp1'];
    $SampleType1 = $_POST['Samp2'];
    $SampleType1 = $_POST['Samp3'];
    $SampleType1 = $_POST['Samp4'];
    $Segmented1 = $_POST['SegmCol1'];
    $LaborDept2 = $_POST['Lab2'];
    $SampleType2 = $_POST['Samp5'];
    $SampleType2 = $_POST['Samp6'];
    $SampleType2 = $_POST['Samp7'];
    $SampleType2 = $_POST['Samp8'];
    $Segmented2 = $_POST['SegmCol2'];
    $LaborDept3 = $_POST['Lab3'];
    $SampleType3 = $_POST['Samp9'];
    $SampleType3 = $_POST['Samp10'];
    $SampleType3 = $_POST['Samp11'];
    $SampleType3 = $_POST['Samp12'];
    $Segmented3 = $_POST['SegmCol3'];
    $LaborDept4 = $_POST['Lab4'];
    $SampleType4 = $_POST['Samp13'];
    $SampleType4 = $_POST['Samp14'];
    $SampleType4 = $_POST['Samp15'];
    $SampleType4 = $_POST['Samp16'];
    $SegmentedCollection = $_POST['SegmCol'];
    $Decleration = $_POST['Decl'];

    mysqli_query($connection, "INSERT INTO `collectsamp`(`SampleID`, `LaborDept`, `NumberofSamples`, `SampleType1`, `Segmented1`, `LaborDept2`, `SampleType2`, `Segmented2`, `LaborDept3`, `SampleType3`, `Segmented3`, `LaborDept4`, `SampleType4`, `SegmentedCollection`, `Decleration`) VALUES ('$LabID', '$LaborDept', '$NumberofSamples', '$SampleType1', '$Segmented1', '$LaborDept2', '$SampleType2', '$Segmented2', '$LaborDept3', '$SampleType3', '$Segmented3', '$LaborDept4', '$SampleType4', '$SegmentedCollection', '$Decleration')");


    Any help would be very much appreciated










    share|improve this question


























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      Can a disabled form element share a column with an enabled form element?



      I have a form which has 4 sets of comboboxes which are populated with data from another table and are only visible and active when certain selections are made, each set of coboboxes contains 4 possible option sets with either one or none visible and active at one time, I have set each set of comboboxes to save to the same table column because there will only ever be one that is working at any time so 4 seperate columns for each set of options would be too complicated when filtering data (in my mind at least).



      The problem that I am having is that I am getting a blank value saved to the database table instead of the selected value, I have place the coding below to help explain what I am trying to do.



      Form coding
      visible/active options



      <select name="Lab1" id="Lab1" style="visibility:hidden;" onChange="if (this.value=='Alpha Bio Labs'){this.form['Samp1'].style.visibility='visible'}
      if (this.value=='Alpha Bio Labs'){this.form['Samp1'].disabled=false}
      if (this.value=='Alpha Bio Labs'){this.form['Samp2'].style.visibility='hidden'}
      if (this.value=='Alpha Bio Labs'){this.form['Samp2'].disabled=true}
      if (this.value=='Alpha Bio Labs'){this.form['Samp3'].style.visibility='hidden'}
      if (this.value=='Alpha Bio Labs'){this.form['Samp3'].disabled=true}
      if (this.value=='Alpha Bio Labs'){this.form['Samp4'].style.visibility='hidden'}
      if (this.value=='Alpha Bio Labs'){this.form['Samp4'].disabled=true}
      if (this.value=='Alpha Bio Labs'){this.form['SegmCol1'].style.visibility='visible'}
      if (this.value=='Alpha Bio Labs'){this.form['SegmCol1'].disabled=false}
      if (this.value=='Cellmark'){this.form['Samp1'].style.visibility='hidden'}
      if (this.value=='Cellmark'){this.form['Samp1'].disabled=true}
      if (this.value=='Cellmark'){this.form['Samp2'].style.visibility='visible'}
      if (this.value=='Cellmark'){this.form['Samp2'].disabled=false}
      if (this.value=='Cellmark'){this.form['Samp3'].style.visibility='hidden'}
      if (this.value=='Cellmark'){this.form['Samp3'].disabled=true}
      if (this.value=='Cellmark'){this.form['Samp4'].style.visibility='hidden'}
      if (this.value=='Cellmark'){this.form['Samp4'].disabled=true}
      if (this.value=='Cellmark'){this.form['SegmCol1'].style.visibility='visible'}
      if (this.value=='Cellmark'){this.form['SegmCol1'].disabled=false}
      if (this.value=='DNA Legal'){this.form['Samp1'].style.visibility='hidden'}
      if (this.value=='DNA Legal'){this.form['Samp1'].disabled=true}
      if (this.value=='DNA Legal'){this.form['Samp2'].style.visibility='hidden'}
      if (this.value=='DNA Legal'){this.form['Samp2'].disabled=true}
      if (this.value=='DNA Legal'){this.form['Samp3'].style.visibility='visible'}
      if (this.value=='DNA Legal'){this.form['Samp3'].disabled=false}
      if (this.value=='DNA Legal'){this.form['Samp4'].style.visibility='hidden'}
      if (this.value=='DNA Legal'){this.form['Samp4'].disabled=true}
      if (this.value=='DNA Legal'){this.form['SegmCol1'].style.visibility='visible'}
      if (this.value=='DNA Legal'){this.form['SegmCol1'].disabled=false}
      if (this.value=='The Doctors Lab'){this.form['Samp1'].style.visibility='hidden'}
      if (this.value=='The Doctors Lab'){this.form['Samp1'].disabled=true}
      if (this.value=='The Doctors Lab'){this.form['Samp2'].style.visibility='hidden'}
      if (this.value=='The Doctors Lab'){this.form['Samp2'].disabled=true}
      if (this.value=='The Doctors Lab'){this.form['Samp3'].style.visibility='hidden'}
      if (this.value=='The Doctors Lab'){this.form['Samp3'].disabled=true}
      if (this.value=='The Doctors Lab'){this.form['Samp4'].style.visibility='visible'}
      if (this.value=='The Doctors Lab'){this.form['Samp4'].disabled=false}
      if (this.value=='The Doctors Lab'){this.form['SegmCol1'].style.visibility='visible'}
      if (this.value=='The Doctors Lab'){this.form['SegmCol1'].disabled=false}
      if (this.value=='Lab'){this.form['Samp1'].style.visibility='hidden'}
      if (this.value=='Lab'){this.form['Samp1'].disabled=true}
      if (this.value=='Lab'){this.form['Samp2'].style.visibility='hidden'}
      if (this.value=='Lab'){this.form['Samp2'].disabled=true}
      if (this.value=='Lab'){this.form['Samp3'].style.visibility='hidden'}
      if (this.value=='Lab'){this.form['Samp3'].disabled=true}
      if (this.value=='Lab'){this.form['Samp4'].style.visibility='hidden'}
      if (this.value=='Lab'){this.form['Samp4'].disabled=true}
      if (this.value=='Lab'){this.form['SegmCol1'].style.visibility='hidden'}
      if (this.value=='Lab'){this.form['SegmCol1'].disabled=true};">
      <option selected>Lab</option>
      <option value="Alpha Bio Labs">Alpha Bio Labs</option>
      <option value="Cellmark">Cellmark</option>
      <option value="DNA Legal">DNA Legal</option>
      <option value="The Doctors Lab">The Doctors Lab</option>
      </select>


      Selection that will be saved to the database



       <option selected >Select Sample Type</option>
      <?php
      $connection = mysqli_connect("", "", "", "");

      $results = mysqli_query($connection, "SELECT SampleType, LabFee, LabFeeExtra FROM `sampletypes` WHERE Lab = 'Alpha Bio Labs'");

      mysqli_close($connection);
      foreach($results as $user): ?>
      <option value="<?= $user['SampleType']; ?>">
      <?= $user['SampleType']; ?>
      </option>
      <?php endforeach; ?>
      </select>


      php coding to save to the database



      $LaborDept = $_POST['Lab1'];
      $SampleType1 = $_POST['Samp1'];
      $SampleType1 = $_POST['Samp2'];
      $SampleType1 = $_POST['Samp3'];
      $SampleType1 = $_POST['Samp4'];
      $Segmented1 = $_POST['SegmCol1'];
      $LaborDept2 = $_POST['Lab2'];
      $SampleType2 = $_POST['Samp5'];
      $SampleType2 = $_POST['Samp6'];
      $SampleType2 = $_POST['Samp7'];
      $SampleType2 = $_POST['Samp8'];
      $Segmented2 = $_POST['SegmCol2'];
      $LaborDept3 = $_POST['Lab3'];
      $SampleType3 = $_POST['Samp9'];
      $SampleType3 = $_POST['Samp10'];
      $SampleType3 = $_POST['Samp11'];
      $SampleType3 = $_POST['Samp12'];
      $Segmented3 = $_POST['SegmCol3'];
      $LaborDept4 = $_POST['Lab4'];
      $SampleType4 = $_POST['Samp13'];
      $SampleType4 = $_POST['Samp14'];
      $SampleType4 = $_POST['Samp15'];
      $SampleType4 = $_POST['Samp16'];
      $SegmentedCollection = $_POST['SegmCol'];
      $Decleration = $_POST['Decl'];

      mysqli_query($connection, "INSERT INTO `collectsamp`(`SampleID`, `LaborDept`, `NumberofSamples`, `SampleType1`, `Segmented1`, `LaborDept2`, `SampleType2`, `Segmented2`, `LaborDept3`, `SampleType3`, `Segmented3`, `LaborDept4`, `SampleType4`, `SegmentedCollection`, `Decleration`) VALUES ('$LabID', '$LaborDept', '$NumberofSamples', '$SampleType1', '$Segmented1', '$LaborDept2', '$SampleType2', '$Segmented2', '$LaborDept3', '$SampleType3', '$Segmented3', '$LaborDept4', '$SampleType4', '$SegmentedCollection', '$Decleration')");


      Any help would be very much appreciated










      share|improve this question















      Can a disabled form element share a column with an enabled form element?



      I have a form which has 4 sets of comboboxes which are populated with data from another table and are only visible and active when certain selections are made, each set of coboboxes contains 4 possible option sets with either one or none visible and active at one time, I have set each set of comboboxes to save to the same table column because there will only ever be one that is working at any time so 4 seperate columns for each set of options would be too complicated when filtering data (in my mind at least).



      The problem that I am having is that I am getting a blank value saved to the database table instead of the selected value, I have place the coding below to help explain what I am trying to do.



      Form coding
      visible/active options



      <select name="Lab1" id="Lab1" style="visibility:hidden;" onChange="if (this.value=='Alpha Bio Labs'){this.form['Samp1'].style.visibility='visible'}
      if (this.value=='Alpha Bio Labs'){this.form['Samp1'].disabled=false}
      if (this.value=='Alpha Bio Labs'){this.form['Samp2'].style.visibility='hidden'}
      if (this.value=='Alpha Bio Labs'){this.form['Samp2'].disabled=true}
      if (this.value=='Alpha Bio Labs'){this.form['Samp3'].style.visibility='hidden'}
      if (this.value=='Alpha Bio Labs'){this.form['Samp3'].disabled=true}
      if (this.value=='Alpha Bio Labs'){this.form['Samp4'].style.visibility='hidden'}
      if (this.value=='Alpha Bio Labs'){this.form['Samp4'].disabled=true}
      if (this.value=='Alpha Bio Labs'){this.form['SegmCol1'].style.visibility='visible'}
      if (this.value=='Alpha Bio Labs'){this.form['SegmCol1'].disabled=false}
      if (this.value=='Cellmark'){this.form['Samp1'].style.visibility='hidden'}
      if (this.value=='Cellmark'){this.form['Samp1'].disabled=true}
      if (this.value=='Cellmark'){this.form['Samp2'].style.visibility='visible'}
      if (this.value=='Cellmark'){this.form['Samp2'].disabled=false}
      if (this.value=='Cellmark'){this.form['Samp3'].style.visibility='hidden'}
      if (this.value=='Cellmark'){this.form['Samp3'].disabled=true}
      if (this.value=='Cellmark'){this.form['Samp4'].style.visibility='hidden'}
      if (this.value=='Cellmark'){this.form['Samp4'].disabled=true}
      if (this.value=='Cellmark'){this.form['SegmCol1'].style.visibility='visible'}
      if (this.value=='Cellmark'){this.form['SegmCol1'].disabled=false}
      if (this.value=='DNA Legal'){this.form['Samp1'].style.visibility='hidden'}
      if (this.value=='DNA Legal'){this.form['Samp1'].disabled=true}
      if (this.value=='DNA Legal'){this.form['Samp2'].style.visibility='hidden'}
      if (this.value=='DNA Legal'){this.form['Samp2'].disabled=true}
      if (this.value=='DNA Legal'){this.form['Samp3'].style.visibility='visible'}
      if (this.value=='DNA Legal'){this.form['Samp3'].disabled=false}
      if (this.value=='DNA Legal'){this.form['Samp4'].style.visibility='hidden'}
      if (this.value=='DNA Legal'){this.form['Samp4'].disabled=true}
      if (this.value=='DNA Legal'){this.form['SegmCol1'].style.visibility='visible'}
      if (this.value=='DNA Legal'){this.form['SegmCol1'].disabled=false}
      if (this.value=='The Doctors Lab'){this.form['Samp1'].style.visibility='hidden'}
      if (this.value=='The Doctors Lab'){this.form['Samp1'].disabled=true}
      if (this.value=='The Doctors Lab'){this.form['Samp2'].style.visibility='hidden'}
      if (this.value=='The Doctors Lab'){this.form['Samp2'].disabled=true}
      if (this.value=='The Doctors Lab'){this.form['Samp3'].style.visibility='hidden'}
      if (this.value=='The Doctors Lab'){this.form['Samp3'].disabled=true}
      if (this.value=='The Doctors Lab'){this.form['Samp4'].style.visibility='visible'}
      if (this.value=='The Doctors Lab'){this.form['Samp4'].disabled=false}
      if (this.value=='The Doctors Lab'){this.form['SegmCol1'].style.visibility='visible'}
      if (this.value=='The Doctors Lab'){this.form['SegmCol1'].disabled=false}
      if (this.value=='Lab'){this.form['Samp1'].style.visibility='hidden'}
      if (this.value=='Lab'){this.form['Samp1'].disabled=true}
      if (this.value=='Lab'){this.form['Samp2'].style.visibility='hidden'}
      if (this.value=='Lab'){this.form['Samp2'].disabled=true}
      if (this.value=='Lab'){this.form['Samp3'].style.visibility='hidden'}
      if (this.value=='Lab'){this.form['Samp3'].disabled=true}
      if (this.value=='Lab'){this.form['Samp4'].style.visibility='hidden'}
      if (this.value=='Lab'){this.form['Samp4'].disabled=true}
      if (this.value=='Lab'){this.form['SegmCol1'].style.visibility='hidden'}
      if (this.value=='Lab'){this.form['SegmCol1'].disabled=true};">
      <option selected>Lab</option>
      <option value="Alpha Bio Labs">Alpha Bio Labs</option>
      <option value="Cellmark">Cellmark</option>
      <option value="DNA Legal">DNA Legal</option>
      <option value="The Doctors Lab">The Doctors Lab</option>
      </select>


      Selection that will be saved to the database



       <option selected >Select Sample Type</option>
      <?php
      $connection = mysqli_connect("", "", "", "");

      $results = mysqli_query($connection, "SELECT SampleType, LabFee, LabFeeExtra FROM `sampletypes` WHERE Lab = 'Alpha Bio Labs'");

      mysqli_close($connection);
      foreach($results as $user): ?>
      <option value="<?= $user['SampleType']; ?>">
      <?= $user['SampleType']; ?>
      </option>
      <?php endforeach; ?>
      </select>


      php coding to save to the database



      $LaborDept = $_POST['Lab1'];
      $SampleType1 = $_POST['Samp1'];
      $SampleType1 = $_POST['Samp2'];
      $SampleType1 = $_POST['Samp3'];
      $SampleType1 = $_POST['Samp4'];
      $Segmented1 = $_POST['SegmCol1'];
      $LaborDept2 = $_POST['Lab2'];
      $SampleType2 = $_POST['Samp5'];
      $SampleType2 = $_POST['Samp6'];
      $SampleType2 = $_POST['Samp7'];
      $SampleType2 = $_POST['Samp8'];
      $Segmented2 = $_POST['SegmCol2'];
      $LaborDept3 = $_POST['Lab3'];
      $SampleType3 = $_POST['Samp9'];
      $SampleType3 = $_POST['Samp10'];
      $SampleType3 = $_POST['Samp11'];
      $SampleType3 = $_POST['Samp12'];
      $Segmented3 = $_POST['SegmCol3'];
      $LaborDept4 = $_POST['Lab4'];
      $SampleType4 = $_POST['Samp13'];
      $SampleType4 = $_POST['Samp14'];
      $SampleType4 = $_POST['Samp15'];
      $SampleType4 = $_POST['Samp16'];
      $SegmentedCollection = $_POST['SegmCol'];
      $Decleration = $_POST['Decl'];

      mysqli_query($connection, "INSERT INTO `collectsamp`(`SampleID`, `LaborDept`, `NumberofSamples`, `SampleType1`, `Segmented1`, `LaborDept2`, `SampleType2`, `Segmented2`, `LaborDept3`, `SampleType3`, `Segmented3`, `LaborDept4`, `SampleType4`, `SegmentedCollection`, `Decleration`) VALUES ('$LabID', '$LaborDept', '$NumberofSamples', '$SampleType1', '$Segmented1', '$LaborDept2', '$SampleType2', '$Segmented2', '$LaborDept3', '$SampleType3', '$Segmented3', '$LaborDept4', '$SampleType4', '$SegmentedCollection', '$Decleration')");


      Any help would be very much appreciated







      php jquery mysql insert






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 9 at 11:35

























      asked Nov 8 at 18:40









      R.Nock

      16




      16
























          1 Answer
          1






          active

          oldest

          votes

















          up vote
          0
          down vote













          I have fixed it by remaking the comboboxes and tweaking the coding to match the snippet below;



          $SampleType4 = $_POST['Samp13'] . " " . $_POST['Samp14'] . " " . $_POST['Samp15'] . " " . $_POST['Samp16'];





          share|improve this answer





















            Your Answer






            StackExchange.ifUsing("editor", function () {
            StackExchange.using("externalEditor", function () {
            StackExchange.using("snippets", function () {
            StackExchange.snippets.init();
            });
            });
            }, "code-snippets");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "1"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53214175%2fcan-a-disabled-form-element-share-a-column-with-an-enabled-form-element%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            0
            down vote













            I have fixed it by remaking the comboboxes and tweaking the coding to match the snippet below;



            $SampleType4 = $_POST['Samp13'] . " " . $_POST['Samp14'] . " " . $_POST['Samp15'] . " " . $_POST['Samp16'];





            share|improve this answer

























              up vote
              0
              down vote













              I have fixed it by remaking the comboboxes and tweaking the coding to match the snippet below;



              $SampleType4 = $_POST['Samp13'] . " " . $_POST['Samp14'] . " " . $_POST['Samp15'] . " " . $_POST['Samp16'];





              share|improve this answer























                up vote
                0
                down vote










                up vote
                0
                down vote









                I have fixed it by remaking the comboboxes and tweaking the coding to match the snippet below;



                $SampleType4 = $_POST['Samp13'] . " " . $_POST['Samp14'] . " " . $_POST['Samp15'] . " " . $_POST['Samp16'];





                share|improve this answer












                I have fixed it by remaking the comboboxes and tweaking the coding to match the snippet below;



                $SampleType4 = $_POST['Samp13'] . " " . $_POST['Samp14'] . " " . $_POST['Samp15'] . " " . $_POST['Samp16'];






                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Nov 9 at 13:47









                R.Nock

                16




                16






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.





                    Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                    Please pay close attention to the following guidance:


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53214175%2fcan-a-disabled-form-element-share-a-column-with-an-enabled-form-element%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    這個網誌中的熱門文章

                    Xamarin.form Move up view when keyboard appear

                    Post-Redirect-Get with Spring WebFlux and Thymeleaf

                    Anylogic : not able to use stopDelay()