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. 【JVM】模板解释器--如何根据字节码生成汇编码?

    1.背景 仅针对JVM的模板解释器: 如何根据opcode和寻址模式,将bytecode生成汇编码. 本文的示例中所使用的字节码和汇编码,请参见上篇博文:按值传递还是按引用? 2.寻址模式 本文不打算 ...

  2. Scala之Map,Tuple

    /** * 1,默认情况下Map构造的是不可变的集合,里面的内容不可修改,一旦修改就变成新的Map,原有的Map内容保持不变: * 2,Map的实例是调用工厂方法模式apply来构造Map实例,而需要 ...

  3. ubuntu中管理用户和用户组

    1. 添加一个用户组并指定id为1002 sudo groupadd -g 1002 www 2. 添加一个用户到www组并指定id为1003 sudo useradd wyx -g 1002 -u ...

  4. windows 7 + vs2010 sp1编译 x64位版qt4

    由于qt官方没有发布预编译的64位版qt4,要使用64位版qt4,只能自己编译,编译过程如下: 1,下载源码并解压到D:\qt-src\qt-everywhere-opensource-src-4.8 ...

  5. 【Moqui业务逻辑翻译系列】Shipment Receiver Receives Shipment with Packing Slip but no PO

    Shipment Receiver receives shipment. It has invoice tucked into it. Receiver records vendor name, ve ...

  6. ansible 配置运行环境

    P34 2.3.1 配置ansible的环境 ansible的配置文件是以ini格式存储配置数据的,在ansible中几乎所有的配置都可以通过playbook或者环境变量来重新赋值 运行ansible ...

  7. [转]Java总结篇系列:Java泛型

    一. 泛型概念的提出(为什么需要泛型)? 首先,我们看下下面这段简短的代码: 1 public class GenericTest { 2 3 public static void main(Stri ...

  8. .net架构设计读书笔记--第二章 第7节 神化般的业务层

    一.编排业务逻辑的模式1. 事务脚本模式TS(The Transaction Script pattern ) TS模式概述     TS 鼓励你跳过任何的面向对象的设计,你直接到所需的用户操作的业务 ...

  9. array,vertor,arraylist,hashable,hashmap等几个易混淆概念的区别

    Array可以存放Object和基本数据类型,但创建时必须指定数组的大小,并不能再改变, Vertor是放的Object. Vertor一维,Hashmap/Hashtabe二维: Vertor/Ar ...

  10. XCode新建Class时自动加前缀(class prefix 修改前缀)

    已经建好的工程,怎么修改class prefix.如图,怎么修改下面的前缀LP,我想改为其他的,比如SH 解决方法: 1.点开Xcode右侧Utilities,Project Document-> ...