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 数学的三元一次方程求解
  • ¥20 iqoo11 如何下载安装工程模式
  • ¥15 本题的答案是不是有问题
  • ¥15 关于#r语言#的问题:(svydesign)为什么在一个大的数据集中抽取了一个小数据集
  • ¥15 C++使用Gunplot
  • ¥15 这个电路是如何实现路灯控制器的,原理是什么,怎么求解灯亮起后熄灭的时间如图?
  • ¥15 matlab数字图像处理频率域滤波
  • ¥15 在abaqus做了二维正交切削模型,给刀具添加了超声振动条件后输出切削力为什么比普通切削增大这么多
  • ¥15 ELGamal和paillier计算效率谁快?
  • ¥15 蓝桥杯单片机第十三届第一场,整点继电器吸合,5s后断开出现了问题