1、
<select class="textEnaSty" name="Port" size="1" onchange="ObtainIPAddr_Enable(this.value)">
<option value="120">Hello</option>
<option value="240">World</option>
</select>

2、页面上不显示,会将内容提交到后台
<input name="Port" type="hidden" value="hello">

3、radio 选项互斥
<input class="textEnaSty" name="FaultResume" type="radio" value="0" checked>

4、php 使能checked的用法
<?php
$Checked="checked"; //勾选上
$Checked=""; // 未勾选
?>

<input name="Port" type="checkbox" value="1" checked>Hello

5、php 使能的 disabled的用法
<?php

$Enable = "disabled";  //disabled = 0 不给用户输入
$Enable = "enabled"; //enabled = 1 给用户输入
?>

<input name="Port" type="text" onChange=GetPmCenterEnable() <?=$Enable; ?> value="1">Hello

6、表单以数组方式提交

<style type="text/css" media="screen">
.tableStyle1{
/*背景 红色*/
background-color:#F00C99;
/*文本*/
text-align:justify;
/*字体*/
font-family:Georgia,serif;
font-style:normal;
font-size:10px;
font-weight:bolder;
/*黑色*/
color:#000F0B;
/*定位*/
margin:auto;
border-width:50px;
border-style:solid;
/*粉红 如果不设则为灰色*/
border-color:#CE1AD4;
border-color:transparent;
padding:50px; }
.tdStyle1{
/*背景 浅绿*/
background-color:#09D6F8;
/*文本*/
text-align:center;
/*字体*/
font-family: Times,Sans-serif,Fantasy;
font-style:normal; /*字体浅灰*/
color:#40308A;
font-size:20px;
/*定位*/
margin:auto;
border-style:none;
border-width:5px;
/*粉红*/
border-color:#DE2AD3; /*border:1px solid #FFFFFF;*/
/* border-width:1px;
border-style:solid;
border-color:#FFFFFF;*/
/* padding:0px;*/ }
.inputStyle{
font-size:15px;
color:#F51515;
padding:0px;
} </style> <div style="margin:auto; width:80%;align:center"> <form action="post_form.php" method="post">
<table class="tableStyle1" width="50%" align="center">
<tr>
<td class="tdStyle1" width="50%" nowrap>公司名称:</td>
<td class="tdStyle1" width="50%" nowrap>
<input type="text" class="inputStyle" name="arr[]" id="company" maxlength="10px">
</td>
</tr>
<tr>
<td class="tdStyle1" nowrap> 姓名:</td>
<td class="tdStyle1" nowrap>
<input type="text" class="inputStyle" name="arr[]" id="name">
</td>
</tr>
<tr>
<td class="tdStyle1" nowrap>年龄:</td>
<td class="tdStyle1" nowrap>
<input type="text" class="inputStyle" name="arr[]" id="age">
</td>
</tr>
</table>
<p>
&nbsp;
</p>
<table width="60%" class="tableStyle1" >
<tr>
<td class="tdStyle1" nowrap>公司名称:</td>
<td class="tdStyle1" nowrap>
<input type="text" name="arr1[work][]" id="company">
</td>
<td nowrap class="tdStyle1">姓名:</td>
<td nowrap class="tdStyle1">
<input type="text" name="arr1[work][]" id="name">
</td>
<td class="tdStyle1" nowrap>年龄:</td>
<td class="tdStyle1" nowrap>
<input type="text" name="arr1[work][]" id="age">
</td>
</tr>
<tr>
<td class="tdStyle1" nowrap>学校:</td>
<td class="tdStyle1" nowrap>
<input type="text" name="arr1[student][]" id="school">
</td> <td class="tdStyle1" nowrap>专业:</td>
<td class="tdStyle1" nowrap>
<input type="text" name="arr1[student][]" id="professor">
</td> <td class="tdStyle1" nowrap>班级:</td>
<td class="tdStyle1" nowrap>
<input type="text" name="arr1[student][]" id="grade">
</td>
</tr>
<tr>
<td>
<input class="tdStyle1" type="radio" name="arr1[student][]" value="0" id="sex">男
</td>
<td>
<input class="tdStyle1" type="radio" name="arr1[student][]" value="1" id="sex">女
</td>
</tr>
</table> <p>
&nbsp;
</p> <table class="tableStyle1">
<tr>
<td class="tdStyle1" nowrap>工作地点</td>
<td class="tdStyle1" nowrap>
<input type="text" name="arr2[work][workplace]" id="workplace">
</td>
<td class="tdStyle1" nowrap>工作内容</td>
<td class="tdStyle1" nowrap>
<input type="text" name="arr2[work][content]" id="content">
</td>
<td class="tdStyle1" nowrap>上班时间</td>
<td class="tdStyle1" nowrap>
<input type="text" name="arr2[work][worktime]" id="worktime">
</td>
</tr>
</table> <p> <div align="center">
<input class="tdStyle1" type="submit" value="确 定">
&nbsp;
<input class="tdStyle1" type="reset" value="取 消">
</div> </form> </div>

后台内容:

用数组方式方便数据库的操作

七、html5表单新属性

http://w3school.com.cn/html5/html_5_form_attributes.asp

新的 form 属性:

  • autocomplete
  • novalidate

新的 input 属性:

  • autocomplete
  • autofocus
  • form
  • form overrides (formaction, formenctype, formmethod, formnovalidate, formtarget)
  • height 和 width
  • list
  • min, max 和 step
  • multiple
  • pattern (regexp)
  • placeholder
  • required

表单元素的写法及与后台php的交互的更多相关文章

  1. Angular11 模板表单、响应式表单(自定义验证器)、HTTP、表单元素双向绑定

    1 模板表单 模型通过指令隐式创建 技巧01:需要在模块级别引入 FormsModule ,通常在共享模块中引入再导出,然后在需要用到 FormsModule 的模块中导入共享模块就可以啦 impor ...

  2. CSS之表单元素

    表单就是收集用户信息的,就是让用户填写的.选择的. 1                <div> 2                         <h3>欢迎注册本网站&l ...

  3. 【原】如何改变表单元素的外观(for Webkit and IE10)

    表单元素在网页设计中使用的非常频繁,如文本输入框.单选框.复选框.选择列表.上传文件,它们在浏览器中的展现有自带的外观,为了在视觉上取得更好的产品体验,保持客户端的统一,通常产品经理会提出需要改变它的 ...

  4. HTML之表单元素

    A.表单元素都是放在<form></form>标签内的.来看看表单的属性  属性 值 描述 accept MIME_type 规定通过文件上传来提交的文件的类型 accept- ...

  5. 动态增加表单元素并获取元素的text和value提交

    以上是效果图 需求是这样的: 专家设置好条件,然后设备检测到达到相应的条件之后,设备发出提醒给用户. 这就需要专家设置好能看懂的条件之后,然后把给专家看的,正常人能看懂的条件和发送的设备的,设备能够识 ...

  6. 表单组件 form fastadmin(生成表单元素)

    Form组件 定义文件位置: /extend/fast/Formphp 通用参数 $name 通常为我们组件的名称(name属性值),我们在后台接收时可以通过这个名称来获取到它所对应的值 $value ...

  7. PHP(表单元素)

    表单: 1.收集用户的输入,发送到后台 <form action="后台地址" method="提交方式" enctype="multipart ...

  8. angular 表单元素的使用总结

    工作中form表单元素最常用的是input,问题没有太多,现在总结下select ,radio组,checkbox的使用 1 select 常用的使用方式,如下 var Cityis = [{id:0 ...

  9. WebForm 【简单控件】【表单元素】

    一.HTML 表单元素复习 (1)文本类 文本框:<input type="text" name="" id="" value=&qu ...

随机推荐

  1. [C++基础]一个比较常用的配置文件/初始化文件读取程序

    在编程中,我们经常会遇到一些配置文件或初始化文件.这些文件通常后缀名为.ini或者.conf,可以直接用记事本打开.里面会存储一些程序参数,在程序中直接读取使用.例如,计算机与服务器通信,服务器的ip ...

  2. 简述WebService的使用(二)

    上集回顾 上一篇我简单的介绍了一下整个WebService建立和后端访问的过程,如果感兴趣可以看一看:简述WebService的使用(一) //如有不懂请留言,觉得有用请点赞 内容提要 这一篇主要介绍 ...

  3. 初探JAVA中I/O流(一)

    一.流 流,这里是对数据交换的形象称法.进程是运行在内存中的,在运行的过程中避免不了会与外界进行数据交互.比如将数据从硬盘.控制台.管道甚至是套接字(具体点应该是我们电脑上的网卡)读到我们进程锁所占据 ...

  4. nginx 日志怎么实现显示真实客户端IP

    这篇文章页不错: http://www.tuicool.com/articles/E32mYf 假如说我们现在的架构是,nginx做反向代理,apache做web服务器.那么我们怎么让我的web服务器 ...

  5. nginx 的源码安装

    安装nginx之前要做的准备工作有:安装如下库 (1)gzip模块需要 zlib 库 (2)rewrite模块需要 pcre 库 (3)ssl 功能需要openssl库 还有一种简单的方法就是 yum ...

  6. 输入年月,输出月份有几天(分别用了if——else和switch)

    首先是switch做的 class Program { static void Main(string[] args) {/* 题目要求:请用户输入年份,输入月份,输出该月的天数. 思路:一年中月份的 ...

  7. IntellJ IDEA 所有快捷键

    登录下面网站. http://www.jetbrains.com/idea/documentation/ 下载Keymap for Windows/Linux 后面的PDF文档.

  8. jquery 在 table 中修改某行值

    修改 table 中某行的的方法步骤如下: 1.选择要修改的行,事件触发,比如我的 双击某行时修改 2.将要修改的行,替换为input,原先的列中的值,需要放到对应的input中作为默认值 3.修改完 ...

  9. sql-where

    查询表时不一定每一次都要将表格内的资料都完全抓出.在许多时候,我们会需要选择性地抓资料.就我们的例子来说,我们可能只要抓出营业额超过 $1,000 的资料. 要做到这一点,需要用到 WHERE 这个指 ...

  10. asp.net input怎么获取值

    前台: <input type="hidden" name="content" value="content"> 后台: Req ...