字段不在表单内发送

时间:2017-05-07 14:36:32

标签: javascript php forms

我有这段代码,我不明白为什么products_twitter不会像其他字段一样发送。元素在里面形成balise

生成的页面摘要

<form name="products_specials" action="http://......./index.php?A&Products%5CSpecials&Specials&Insert" method="post">
<a href="......../index.php?A&Products%5CSpecials&Specials&Specials&page=1" target="_self" class="btn btn-warning">Annuler</a>&nbsp;
<button type="submit" class="btn  btn-success">Insérer</button>


        <div class="mainTitle">Informations sur le produit</div>
        <div class="adminformTitle" id="tab1Specials">
          <div class="row">
            <div class="col-md-5">
              <div class="form-group row">
                <label for="Produit :" class="col-5 col-form-label">Produit :</label>
                <div class="col-md-5">
                  <select name="products_id" class="form-control" />
<option value="16">Bureau d'accueil (Client Normal: &nbsp;1.00&nbsp;EUR - Tarifs 1 : &nbsp;0.95&nbsp;EUR)
</option>
                  </select>
                  <input type="hidden" name="products_price" />                
                </div>
              </div>
            </div>
          </div>
  </div>


<!-- the problem is here appear inside the form but not sent (products_twitter) -->

<!--  Start TwitterApp      -->
<script>
$('#tab1Specials').append(
    '<div class="row"><div class="col-md-5"><div class="form-group row"><label for="Souhaitez-vous publier ce produit sur Twitter ?" class="col-5 col-form-label">Souhaitez-vous publier ce produit sur Twitter ?</label><div class="col-md-5"><input type="radio" name="products_twitter" id="products_twitter" value="1" />&nbsp;Oui&nbsp;<input type="radio" name="products_twitter" id="products_twitter" value="on" />&nbsp;Non</div></div></div></div>'
);
</script>
<!--  End TwitterApp      -->
  </form>

start twitter和end twitter之间的代码是这些元素:我用include调用元素。

       $content1 = '<div class="row">';
       $content1 .= '<div class="col-md-5">';
       $content1 .= '<div class="form-group row">';
       $content1 .= '<label for="' . $this->app->getDef('text_twitter') . '" class="col-5 col-form-label">' . $this->app->getDef('text_twitter') . '</label>';
       $content1 .= '<div class="col-md-5">';
       $content1 .= HTML::radioField('products_twitter', '1', $pInfo->in_accept_twitter) . '&nbsp;' . $this->app->getDef('text_yes') . '&nbsp;' . HTML::radioField('products_twitter', '0', $pInfo->out_accept_twitter) . '&nbsp;' . $this->app->getDef('text_no');
       $content1 .= '</div>';
       $content1 .= '</div>';
       $content1 .= '</div>';
       $content1 .= '</div>';

      $output = <<<EOD
<!--  Start TwitterApp      -->
<script>
$('#tab1Specials').append(
    '{$content1}'
    );
    </script>
    <!--  end TwitterApp      -->
EOD;

发送的唯一元素是($_POST):

array(6) { ["products_id"]=> string(2) "16" ["products_price"]=> string(0) "" ["specials_price"]=> string(2) "10" ["customers_group"]=> string(0) "" ["schdate"]=> string(0) "" ["expdate"]=> string(0) "" } 

0 个答案:

没有答案