html:表单页面中间_HTML表单:简介

html:表单页面中间

Forms are ubiquitous on the web. Any time you provide a username and password to log into a site, add a comment to a blog, or order anything online, you are filling out a form. Before we start, there are two important areas that you need to understand will be unaddressed at this time:

表单在网络上无处不在。 每当您提供用户名和密码登录网站,在博客中添加评论或在线订购任何东西时,您都在填写表格。 在开始之前,您需要了解两个重要的领域,这些领域目前尚未解决:

  1. We will not have the opportunity to cover the processing of form data, i.e. what happens after the user clicks the “Submit” button. HTML allows you to create a form, but does not process it: inserting user data into a database or sending the information in a formatted eMail are the role of JavaScript, , Perl, or an alternative. Processing of form data is covered in later articles.

    我们将没有机会介绍表格数据的处理 ,即用户单击“提交”按钮后会发生什么。 HTML允许您创建表单,但不能对其进行处理: JavaScript ,Perl或其他角色可 将用户数据插入数据库以格式化的电子邮件形式发送信息 。 以后的文章中介绍了表单数据的处理。

  2. The form we create will work just fine (up until the moment the user presses submit), but will look terrible. We use CSS to control the appearance of forms, which is again covered in a later article.

    我们创建的表单可以很好地工作(直到用户按下“提交”的那一刻),但是看起来很糟糕。 我们使用CSS控制表单的外观,这将在以后的文章中再次介绍。

Learners are often tempted to add more markup to their forms to make them “look better”. I know it is frustrating to create a form that doesn’t look the way you want it to, but please don’t add markup other than what you learn here. You’ll only be adding redundant or irrelevant tags that will get in the way when we add CSS to forms.

学习者经常倾向于在表单中添加更多标记,以使其“看起来更好”。 我知道创建看起来不像您期望的形式的表单很令人沮丧,但是请不要添加任何标记,除非您在此处学到了什么。 您将只添加多余或不相关的标签,这些标签会在我们向表单添加CSS时造成干扰

As your add markup to your page and test the form (by entering data into textboxes, making selections from drop-down menus, etc) the browser will remember what you have entered, even after refreshing the page. (This is a feature added to prevent those who do accidentally refresh the page from losing their information). In order to see a truly renewed form, you will have to hard refresh the page. The keyboard shortcut to do this will change from one browser to the next. (CMD-SHIFT-R for Firefox on the Mac, as one example).

当您在页面上添加标记并测试表单时(通过在文本框中输入数据,从下拉菜单中进行选择等),即使刷新页面后,浏览器也会记住您输入的内容。 (添加此功能是为了防止那些小心刷新页面的人丢失其信息)。 为了查看真正更新的表单,您将不得不硬刷新页面。 执行此操作的键盘快捷方式将从一个浏览器更改为另一个浏览器。 (例如,在Mac上为Firefox使用CMD-SHIFT-R )。

翻译自: https://thenewcode.com/35/HTML-Forms-Introduction

html:表单页面中间

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值