Home > other >  When submitting a form is there a way to not only send the inputs but also all the froms content?
When submitting a form is there a way to not only send the inputs but also all the froms content?

Time:03-25

when submitting the form and I look in the $_POST variable, then I only find the values of the form inputs. But I want to access also all the other variables. Is there a way to send them also? e.g. how could I send also the content of multiplicator1 in the variable?

<form>
 <table>
  <tr>
   <td><input  name="inputFieldsInput1" value="0" /></td>
   <td  id="multiplicator1">5</td>
   <td  id="uniqueProduct1">0.00</td>
  </tr>
 </table>
<form>

CodePudding user response:

You can use input type="hidden" like in following code:

<form>
     <table>
      <tr>
       <td><input  name="inputFieldsInput1" value="0" /></td>
       <td  id="multiplicator1">5</td>
       <td  id="uniqueProduct1">0.00</td>
      </tr>
     </table>

     <!-- Enter multiplicator1 and uniqueProduct1 values into input type hidden -->
     <input type="hidden" name="multiplicator1" value="5">
     <input type="hidden" name="uniqueProduct1" value="0.00">
 <form>
  • Related