dongwo6477 2013-02-14 05:20
浏览 27
已采纳

<select>未填充,按钮与<select>内联

I'm working with html, php and bootstrap to create some lists and buttons. My first questions is that I have written a script populate a "select" drop down list. It should go to the "sounds/" directory and populate itself with .wav files. The "select" shows up properly, it just doesn't populate the list. I do have .wav files in the directory and I gave full permissions to the directory itself. So its not that.

My other question is how would I put a button inline with the the "select" drop down. I don't want on the next line down.

<!--CALL TAB-->
<div id="call">
  <div class="container">
  <div class="hero-unit">
      <h5>Call Functions -</h5>
      <h6>Test Paragraph</h6>

      <br>

      <h6> Select a Sound One -</h6>
      <div class="row">
        <div class="span2">
          <select id="sound1">
            <?php 
              foreach(glob('sounds/*.wav') as $filename){
              $rest = substr($filename, 7);    
              echo "<option>".$rest."</option>";
              }
            ?>
          </select>
        </div>
      </div>

      <br>

      <h6> Select a Sound Two -</h6>
      <div class="row">
        <div class="span2">
          <select id="sound2"> 
            <?php 
              foreach(glob('sounds/*.wav') as $filename){
              $rest = substr($filename, 7);    
              echo "<option>".$rest."</option>";
              }
            ?>
          </select>
        </div>
      </div>

      <br>

      <h6>Volume - </h6>
      <div id="slider-range-max">
      </div>
    <div class="row">
      <div class="span6">
        <br>
        <p><a class="btn btn-large btn-primary" href="index.html">Play <i class="icon-   play"></i></a> <a class="btn btn-large btn-danger" href="index.html">Pause <i class="icon-pause"></i></a>
      </div>
    </div>
  </div>

  <hr>

    <footer>
      <p>&copy; FOOTER</p>
    </footer>
  </div>
</div>
  • 写回答

1条回答 默认 最新

  • douren1928 2013-02-14 05:40
    关注

    Getting the button next to the select is simple. If you're not styling the select or button to be a block element, then they should appear next to each other (inline block). If the HTML below doesn't work for you (button is not next to select), then try adding float: left; to both the select and button.

    For your glob(), are you sure the path is correct? Where is the PHP file that's executing this versus the sounds folder? What's your directory structure?

    http://jsfiddle.net/3JQeZ/

    <div class="row">
        <div class="span2">
            <select id="sound1">
                <option>1 option</option>
                <option>2</option>
                <option>3</option>
            </select>
            <button>Button</button>
        </div>
    </div>
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
  • ¥15 ETLCloud 处理json多层级问题
  • ¥15 matlab中使用gurobi时报错
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭
  • ¥15 2020长安杯与连接网探
  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么