dsfdfdfd6576578 2012-08-28 18:59
浏览 71
已采纳

提交按钮的形式不能在php打印

EDIT: Answered by a comment, thank you!

Does < form > not work within php's print?

I've been working through this page, building the pieces I want it to have- my final glitch is that the submit button is not active AT ALL.

I have a page that uses jquery to hide a div that contains information submitted by the user- these are shown when the administrator clicks on the button to show the abstract.

In the div that is hidden, there are two columns- one of which has a super short form- the admin clicks on a radio button to categorize the submitted information. This is where the submit button simply isn't working.

The form shows up, in fact, everything looks exactly as expected. I know the code otherwise works because I tried it by itself on another page- so I'm assuming there's knowledge I do not have and cannot find.

Any advice?

<?php
 include('filethatconnectstothedatabase.php');
 $conn = new DatabaseConn();
 $query = ("
          SELECT *
          FROM abstracts
          WHERE visible=\"1\"
          ");
 $result = mysql_query($query);

 $numfields = mysql_num_fields($result);
 $data = array();
 $flist = array();

for($i=0;$i<$numfields;$i++)$flist[] = mysql_field_name($result,$i);
  $data[0] = $flist;
  while($row = mysql_fetch_assoc($result)){
  $data[] = $row;

print '

<div id="table-'.$row['abstractid'].'" class="hide">
   <div class="column1">
   <ul>
    <li>
   <span class="spantitle">Author:</span> ' . $row['abstract_author'] .'
   </li>

   <li><span class="spantitle">Applicant Type:</span> ' . $row['applicant_type'] .'
   </li>

   <li>
    <span class="spantitle">Presentation Type:</span> ' . $row['presentation_type'] .'
   </li>

   <li>
  <span class="spantitle">Affiliation:</span> ' . $row['author_affiliation'] .'
  </li>

  <li>
 <button data-hide-id="'.$row['abstractid'].'" class="read-abstract">
  Hide Abstract
 </button>
</li>

</ul>

<div class="clr"></div>

<form action="assign_abstract.php" method="post">

<fieldset>
  <span class="spantitle">Assign Session for abstract # '. $row['abstract_id'] .':</span>
  <input type="hidden" name="abstract_id" value="'. $row['abstract_id'] .'" />

  <br />
  <input type="radio" name="abstract_category" value="session1" />Session One:
  <br />
  Session One

  <br />
  <input type="radio" name="abstract_category" value="session2" />Session Two:
  <br />
  Session Two

  <br />
  <input type="radio" name="abstract_category" value="session3" />Session Three:
  <br />
  Session Three

  <br />
  <input type="radio" name="abstract_category" value="session4" />Session Four:
  <br />
  Session Four

  <br />
  <input type="radio" name="abstract_category" value="notapplicable" />Not Applicable

  <br />
  <br />
  <input type="button" name="submit" value="submit" />

  </fieldset>

  </form>
  • 写回答

2条回答 默认 最新

  • douxian1770 2012-08-28 19:04
    关注

    Forms work fine inside of php echo's and prints. Did you try type submit instead of type button? Example:

    <input type="submit" name="submit" value="submit" />
    

    instead of

    <input type="button" name="submit" value="submit" />
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 ads仿真结果在圆图上是怎么读数的
  • ¥20 Cotex M3的调试和程序执行方式是什么样的?
  • ¥20 java项目连接sqlserver时报ssl相关错误
  • ¥15 一道python难题3
  • ¥15 用matlab 设计一个不动点迭代法求解非线性方程组的代码
  • ¥15 牛顿斯科特系数表表示
  • ¥15 arduino 步进电机
  • ¥20 程序进入HardFault_Handler
  • ¥15 oracle集群安装出bug
  • ¥15 关于#python#的问题:自动化测试