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#基础之枚举

    1.认识Enum 以前一直以为Enum是值类型,在VS中查看Enum的定义时才发现它是一个抽象的类.但是这个类很奇怪,Enum继承了ValueType这个很熟悉的值类型基类,它是唯一一个继承自Valu ...

  2. js实现黑客帝国二进制雨

    置顶文章:<纯CSS打造银色MacBook Air(完整版)> 上一篇:<对于RegExp反向引用的一点理解> 作者主页:myvin 博主QQ:851399101(点击QQ和博 ...

  3. 10、面向对象以及winform的简单运用(isMdicontainer的设置、timer控件进行倒计时的制作)

    IsMdicontainer的设置 这是对于整个窗体的设置,将一个窗体的IsMdicontainer设置为true之后,再打开新窗体便可以让新窗体被父容器包括在内. 操作方法: 1)先建立一个子窗体C ...

  4. Bootstrap3.0学习第二十轮(JavaScript插件——滚动监听)

    详情请查看 http://aehyok.com/Blog/Detail/26.html 个人网站地址:aehyok.com QQ 技术群号:206058845,验证码为:aehyok 本文文章链接:h ...

  5. 关于js的string的3个函数slice,substring,substr对比

    slice,substring,substr三个函数都是截取字符串,但是对参数的处理有区别 参数处理相似的两个函数式slice和substring slice(start,end)和substring ...

  6. Mac上git的安装配置与使用简述

    Mac下git搭建及使用 之前就只是经常在GitHubs上下载代码,也没注意怎么上传项目.一开始对git都没什么了解花了几个小时去小补了下知识.如果有需要可以转去这里学习:[GIT使用简易指南] (h ...

  7. 图片百分百问题 z-index问题

    遇到的问题:     1.图片设置宽高都为100%,为什么高度没有100%呢?  我日了狗了!         答:因为图片默认高度大于包含框, 此时元素的高度100%将不会参照父元素? 继承出现了问 ...

  8. OpenLayers中地图缩放级别的设置方法

    来源于:http://www.cnblogs.com/sailheart/archive/2011/03/15/1984519.html 一.概述 在OpenLayers中,地图必须具有一个缩放级别的 ...

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

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

  10. 【BZOJ 3143】【Hnoi2013】游走 期望+高斯消元

    如果纯模拟,就会死循环,而随着循环每个点的期望会逼近一个值,高斯消元就通过列方正组求出这个值. #include<cstdio> #include<cctype> #inclu ...