jeudi 24 mars 2016

How to pass value of hidden field and number field associated with checkbox to the next page?

i have a set of checkboxes and i want to pass their value of the selected checkbox onto the next page along with the value of the hidden field and number field associated with it.

and Here's my code

<form name="testform" method="post" action="page2.php">
<li>
<label>        
  <input type="checkbox" id="itemprice1" name="Itemprice[]" value="350" onclick="total(this.form);"/>
  <?php the_post_thumbnail(); ?><p><?php echo get_the_title(); ?></p>
  <input min="0" max="5" type="number" class="quantity" name="quantity" value="1" onclick="total(this.form);"/>
  <input type="hidden" name="Itemname[]" value="Item A">
</label>
</li>

<li>
<label>        
  <input type="checkbox" id="itemprice2" name="Itemprice[]" value="250" onclick="total(this.form);"/>
  <?php the_post_thumbnail(); ?><p><?php echo get_the_title(); ?></p>
  <input min="0" max="5" type="number" class="quantity" name="quantity" value="1" onclick="total(this.form);"/>
  <input type="hidden" name="Itemname[]" value="Item B">
</label>
</li>

<li>
<label>        
  <input type="checkbox" id="itemprice3" name="Itemprice[]" value="350" onclick="total(this.form);"/>
  <?php the_post_thumbnail(); ?><p><?php echo get_the_title(); ?></p>
  <input min="0" max="5" type="number" class="quantity" name="quantity" value="1" onclick="total(this.form);"/>
  <input type="hidden" name="Itemname[]" value="Item C">
</label>
</li>
<input type="submit" name="fb" value="small" />
</form> 




Aucun commentaire:

Enregistrer un commentaire