Récupérer variable liste déroulante
thomas59
Messages postés
14
Statut
Membre
-
Kentin76250 Messages postés 241 Statut Membre -
Kentin76250 Messages postés 241 Statut Membre -
Bonjour,
Je souhaite récupéré une variable provenant d'une liste déroulante. voici mon code formulaire.
je souhaite récupéré le champ product_list:
je fais $_POST['product_list'] mais rien n'y fais je n'arrive pas à la récupéré. Le pire est que j'ai utilisé ce meme code dans une autre page et cela fonctionne très bien.
$productsList = Product::GetListByIdCultureCode($cultureCode);
<form method="post" action="" enctype="multipart/form-data">
<ul class="form">
<li>
<label for="store_name"><?php echo $lang['stores']['label_name'] ?> *</label>
<input type="text" id="store_name" name="store_name" class="text" value="<?php echo $_POST['store_name'] ?>" />
</li>
<li>
<label for="id_ens"><?php echo $lang['stores']['label_ens'] ?> *</label>
<input type="text" id="id_ens" name="id_ens" class="text" value="<?php echo $_POST['id_ens'] ?>" />
</li>
<li>
<label for="cli_id"><?php echo $lang['stores']['cli_id'] ?> *</label>
<input type="text" id="cli_id" name="cli_id" class="text" value="<?php echo $_POST['cli_id'] ?>" />
</li>
<li>
<label for="distriboffice"><?php echo $lang['stores']['distriboffice'] ?> *</label>
<input type="text" id="distriboffice" name="distriboffice" class="text" value="<?php echo $_POST['distriboffice'] ?>" />
</li>
<li>
<label for="store_address"><?php echo $lang['stores']['label_address'] ?> *</label>
<textarea id="store_address" name="store_address" class="text"><?php echo $_POST['store_address'] ?></textarea>
</li>
<li>
<label for="store_addressb"><?php echo $lang['stores']['label_address2'] ?> *</label>
<textarea id="store_addressb" name="store_addressb" class="text"><?php echo $_POST['store_addressb'] ?></textarea>
</li>
<li>
<label for="store_postal_code"><?php echo $lang['stores']['label_postal_code'] ?> *</label>
<input type="text" id="store_postal_code" name="store_postal_code" class="text" value="<?php echo $_POST['store_postal_code'] ?>" />
</li>
<li>
<label for="store_city"><?php echo $lang['stores']['label_city'] ?> *</label>
<input type="text" id="store_city" name="store_city" class="text" value="<?php echo $_POST['store_city'] ?>" />
</li>
<li>
<label for="store_country"><?php echo $lang['stores']['label_country'] ?> *</label>
<select id="store_country" name="store_country" class="text">
<?php foreach($countriesList as $currentCountry): ?>
<option value="<?php echo $currentCountry->id ?>"<?php if( isset($_POST['store_country']) && $_POST['store_country'] == $currentCountry->id ): ?> selected="selected"<?php endif; ?>><?php echo utf8_encode($currentCountry->label) ?></option>
<?php endforeach; ?>
</select>
</li>
<li>
<label for="product_list"><?php echo $lang['global']['products_list'] ?> *</label>
<select id="product_list" name="product_list" class="text" >
<?php foreach($productsList as $currentProduct): ?>
<option value="<?php echo $currentProduct->id ?>"<?php if( isset($_POST['product_list']) && $_POST['product_list'] == $currentProduct->id ): ?> selected="selected"<?php endif; ?>><?php echo $currentProduct->title ?></option>
<?php endforeach; ?>
</select>
</li>
<li><input type="submit" class="btn2" value="<?php echo $lang['global']['bt_submit']; ?>" /></li>
</ul>
</form>
Je souhaite récupéré une variable provenant d'une liste déroulante. voici mon code formulaire.
je souhaite récupéré le champ product_list:
je fais $_POST['product_list'] mais rien n'y fais je n'arrive pas à la récupéré. Le pire est que j'ai utilisé ce meme code dans une autre page et cela fonctionne très bien.
$productsList = Product::GetListByIdCultureCode($cultureCode);
<form method="post" action="" enctype="multipart/form-data">
<ul class="form">
<li>
<label for="store_name"><?php echo $lang['stores']['label_name'] ?> *</label>
<input type="text" id="store_name" name="store_name" class="text" value="<?php echo $_POST['store_name'] ?>" />
</li>
<li>
<label for="id_ens"><?php echo $lang['stores']['label_ens'] ?> *</label>
<input type="text" id="id_ens" name="id_ens" class="text" value="<?php echo $_POST['id_ens'] ?>" />
</li>
<li>
<label for="cli_id"><?php echo $lang['stores']['cli_id'] ?> *</label>
<input type="text" id="cli_id" name="cli_id" class="text" value="<?php echo $_POST['cli_id'] ?>" />
</li>
<li>
<label for="distriboffice"><?php echo $lang['stores']['distriboffice'] ?> *</label>
<input type="text" id="distriboffice" name="distriboffice" class="text" value="<?php echo $_POST['distriboffice'] ?>" />
</li>
<li>
<label for="store_address"><?php echo $lang['stores']['label_address'] ?> *</label>
<textarea id="store_address" name="store_address" class="text"><?php echo $_POST['store_address'] ?></textarea>
</li>
<li>
<label for="store_addressb"><?php echo $lang['stores']['label_address2'] ?> *</label>
<textarea id="store_addressb" name="store_addressb" class="text"><?php echo $_POST['store_addressb'] ?></textarea>
</li>
<li>
<label for="store_postal_code"><?php echo $lang['stores']['label_postal_code'] ?> *</label>
<input type="text" id="store_postal_code" name="store_postal_code" class="text" value="<?php echo $_POST['store_postal_code'] ?>" />
</li>
<li>
<label for="store_city"><?php echo $lang['stores']['label_city'] ?> *</label>
<input type="text" id="store_city" name="store_city" class="text" value="<?php echo $_POST['store_city'] ?>" />
</li>
<li>
<label for="store_country"><?php echo $lang['stores']['label_country'] ?> *</label>
<select id="store_country" name="store_country" class="text">
<?php foreach($countriesList as $currentCountry): ?>
<option value="<?php echo $currentCountry->id ?>"<?php if( isset($_POST['store_country']) && $_POST['store_country'] == $currentCountry->id ): ?> selected="selected"<?php endif; ?>><?php echo utf8_encode($currentCountry->label) ?></option>
<?php endforeach; ?>
</select>
</li>
<li>
<label for="product_list"><?php echo $lang['global']['products_list'] ?> *</label>
<select id="product_list" name="product_list" class="text" >
<?php foreach($productsList as $currentProduct): ?>
<option value="<?php echo $currentProduct->id ?>"<?php if( isset($_POST['product_list']) && $_POST['product_list'] == $currentProduct->id ): ?> selected="selected"<?php endif; ?>><?php echo $currentProduct->title ?></option>
<?php endforeach; ?>
</select>
</li>
<li><input type="submit" class="btn2" value="<?php echo $lang['global']['bt_submit']; ?>" /></li>
</ul>
</form>
A voir également:
- Récupérer variable liste déroulante
- Liste déroulante excel - Guide
- Liste déroulante en cascade - Guide
- Recuperer message whatsapp supprimé - Guide
- Récupérer mon compte facebook désactivé - Guide
- Comment recuperer une video sur youtube - Guide