如何在此代码中显示php代码?

时间:2016-09-06 07:58:37

标签: javascript php html css css3

朋友我有问题, 我可以发布我的表格,但我不能发布下拉值?

我将选择一个下拉值,然后我想用表格发送这些值。它发布但始终发布此454354325值。如何使用选定的下拉值发布?

最后!! 好吧我修复了除了在下拉值中显示php代码之外的所有问题。

如何在下拉值之间显示php代码?

     function btn(container, btnElem) {

  // Launch Dialog
  bootbox.dialog({
      message: '<div class="container-fluid">' +
      '<div class="col-md-12">' +
      '<form class="form-horizontal"> ' +
      '<div class="form-group"> ' +
      '<label for="sel1">Select list (select one):</label>'+
      '<select class="form-control" name="sel1" value="" id="sel1">'+
      '<option value="<?php include "test.php" ;?>"> Test</option>'+
      '<option value="<?php include "test2.php"; ?>">Test2</option>'+
      '</select>'+
      '</form> </div> </div></div>',
    title: "Please selec a value",
    buttons:{
      success: {
        label: "Select a Value",
        className: "btn-success",
          // Main Callback: takes the youTube URL and finds the ID, then returns the embed code
          callback: function(){
          var html="",
             $a =  document.getElementById("sel1").value,
            html= $a;

            // Add Back to Gridmanger, and wrap in editable region
            gm.addEditableAreaClick(container, btnElem, html);
          }
      }
    }
  });

}

1 个答案:

答案 0 :(得分:0)

您的解决方案中有一个双逗号(&#34;)错过了Html。请在bootbox.dialog函数中找到它并使用此html

 <option value="TEST-VALUE"> Test</option>

而不是

<option value=TEST-VALUE"> Test</option>