JSP表格页面布局问卷调查

来源:互联网 发布:iphone7数据恢复失败 编辑:程序博客网 时间:2024/06/13 09:32

1

制作衣蛾读者问卷调查

1)以表格的方式对页面继续布局,显示调查问卷的题目及答案

2)提交答案信息和电话号码后,显示提价结果

相关知识点

页面代码

<center><h2>读者调查问卷</h2><hr><!--标题居中,加下划线-->

   <!--  添加表单,里面嵌套表格-->

   <form action="resutl.jsp" method="post"><!-- action提价到结果页面 -->

    <table width="408" border="1" cellpadding="5" cellspacing="0"><!--cellpadding表示的是单元与单元之间的距离,spacing是内容-->

    <tr><td colspan="2">感谢您使用本书,请您填写调查问卷</td></tr>  <!--让他占2colspan所写2 -->

      <!-- 一行2-->

    <tr><td width="161" bgcolor="#f0f0f0">您对该书的评价</td>

    <td width="221">

    <input type="radio" name="question1" value="1">很好

    <input type="radio" name="question1" value="2">一般

    <input type="radio" name="question1" value="3">很差

    </td>

    </tr>

     <!-- 一行2-->

    <tr><td width="161" bgcolor="#f0f0f0">这本书的用途</td>

    <td width="221">

    <input type="radio" name="question1" value="1">很好

    <input type="radio" name="question1" value="2">一般

    <input type="radio" name="question1" value="3">很差

    </td>

    </tr>

     <!-- 一行2-->

    <tr><td width="161" bgcolor="#f0f0f0">您是从哪里看到这本书的</td>

    <td width="221">

    <input type="radio" name="question1" value="1">很好

    <input type="radio" name="question1" value="2">一般

    <input type="radio" name="question1" value="3">很差

    </td>

    </tr>

    <!-- 一行2-->

    <tr><td width="161" bgcolor="#f0f0f0">您的电话号码是</td>

    <td width="221">

    <input type="text" name="phone" size="30" maxLength="50"><!-- maxLength输入字数 -->

    </td>

    </tr>

    <!-- 一行1-->

    <!-- 问题:如何让按钮居中-->

    <!--  解决:style="text-align:center"-->

    <tr bgcolor="#f0f0f0" >

    <td colspan="2" style="text-align:center">

    <input name="submit" type="submit" value="提交">

    </td>

    </tr>

     

    </table>

   </form>

   </center>

 

结果页面

  <%

   String phone=request.getParameter("phone");//获取文本框中的值

   out.print("读者"+phone+"感谢填写问卷");

%>

注意

提交页面错误有可能是文件名写错


0 0
原创粉丝点击